Is there any way to pass variables from JS to PHP?
I thought of a couple ways myself...
1. Create a window with a url like this: http://www.site.com/JS2PHP.php?varlist=Name:JSinputname|Age:50|Exit:Yes, then use PHP to split the "|" then split the ":" and then after 1 second, automatically close the popup since the variables are passed... then what? Can you do this with PHP 5?
Will that variable be accesible from this?PHP Code:<?PHP
// JS2PHP.php
$VarList = $_GET["varlist"];
?>
2. using thisPHP Code:<?PHP
// EchoVar.php
echo $VarList;
?>
HTML Code:<SCRIPT> var JSVAR = nameinput.value; document.write("<?PHP $JS_Var = \"" + JSVAR + "\"; ?>"); </SCRIPT>




Reply With Quote