Passing JavaScript to a PHP script

Simple code that will help you to pass javascript to a php variable.

<script language=”javascript”>
var java= “Content from javascript”;
</script>
<?php
$php = ‘<script language=”javascript”>document.write(java)</script>’;
echo $php;
?>

This entry was posted in PHP tutorials and tagged , , , , , , . Bookmark the permalink.




Comments are closed.