Hi Every one.
I finally figured a way to [B]pass JavaScript variables to PHP.
I takes 3 files.
[B]1. Setup file a PHP or HTML
<script language=”javascript”>
var1= 9;
var2= 19;
var3= ‘time’;
</script>
<!– now we are calling the sender script –>
<script language=”javascript” src=”sendpar.js”></script>
[B]2. the “translation” file is a JavaScript FORM
document.write(‘<form name=”sendme” action=”showpar.php” method=”post”><input type=”hidden” name=”par1″ ><input type=”hidden” name=”par2″ ><input type=”hidden” name=”par3″ >’);
sendme.par1.value = var1;
sendme.par2.value = var2;
sendme.par3.value = var3;
document.write(‘</form>’);
document.sendme.submit() ;
[B]3. is the PHP “receiver file”
just a simple file to show you all values:
<?php
foreach($_POST as $key => $dat) {
echo $key .’=’. $dat .”rn”;
}
?>
That is ALL. ?
Good Luck!