MySpaza - How To
Web Design Tips and PC and Linux Related Information

Subscribe
 



    follow me on Twitter

    PHP / Javascript Alerts - Quick an easy Alert function
    PHP Javascript Alert Function

    Added: 2008-05-19 08:51:25

    This is a simple function that can be added to your codebase, or global.inc.php that will mean you never have to write a javascript alert again, just call the PHP function.

    function alert($alert) {
     $out .='<script type="text/javascript">
       alert("'.$alert.'");
       </script>
       ';
       
     print $out;
     
     }

    Now just make a PHP call to alert();

    <? alert("Hello PHP World, this is a Javascript Alert"); ?>




    Add a comment to this post
    Email confirmation is required for each post

    Name:
    Email:
    Comment:
     

    Comments from other users:




    Copyright MySpaza.Co.Uk - 2010