...

View Full Version : In JavaScript can I use Php



goodclassified1
08-17-2011, 09:50 PM
Hi
I need Help can I use Java Script in php orrr php in javascript.
http://www.goodclassified.com/
Please Reply Soon Example

Philip M
08-17-2011, 09:58 PM
Not sure what you mean by "use".

You just echo/print the javascript like you would do with html, like:

<?
echo "<script type='text/JavaScript'>\n";
echo "alert('Javascript from php');\n";
echo "</script>";
?>

Suggest you Google for more information on how php and Javascript can (and cannot) interact.
Example:-
http://www.skytopia.com/project/articles/compsci/form.html

It is your responsibility to die() if necessary….. - PHP Manual



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum