Posted by Lance on 02/07/06 05:17
First of all, save your file as a PHP file.
next assign a statement to your php variable. i.e
<? $dane="me"; ?>
Insert the javascript tag i.e
<script>
Next enter define your javascript variable and assign your PHP variable
to the Javascript variablei.e
var danevar=<?= $dane; ?>
//display to confirm
alert(danevar);
or concatenate using javascript
alert('This is from the PHP variable'+'<?= $dane ?>');
alert('This is from the Javascript variable'+danevar);
</script>
<? ?>
[Back to original message]
|