Saturday, April 08, 2006

How to use Javascript in PHP-Nuke blocks

How to use Javascript in PHP-Nuke blocks: "20.5. How to use Javascript in PHP-Nuke blocks

Javascript can be used with PHP-Nuke without problems, as long as you remember that they operate in different environments (see Frames, JavaScript, and PHP Overview):

*

PHP-Nuke, like PHP, is server side. Therefore, if you want to pass data from a form to PHP-Nuke, you have to submit it and load the page again. There is no getting around it.
*

Javascript is client side (run in the browser), and can help you with dynamic functionality. You can easily use JavaScript and PHP-Nuke together. However, just like PHP, PHP-Nuke knows nothing about Javascript. PHP-Nuke will just echo the Javascript code to the HTML page, just as it would echo the value of a string variable.

Thus, from the point of view of PHP and PHP-Nuke, there is no difference between



and



';
?>

They both echo strings, of which the first one is simply displayed in the client's browser as a welcome message, while the second one"