Page 1 of 1

use javascript variable ina php code

Posted: Fri Jul 08, 2011 2:50 am
by ishakya
Hi all,
I am saving some check box ids in a java script variable when a check box is clicked.
So after that i need to pass that variable to a another page via url in a php code....
so can anyone please help me to solve this.....

Thanks in advance

Re: use javascript variable ina php code

Posted: Fri Jul 08, 2011 4:38 am
by social_experiment
Data passed via the url can be accessed by using the $_GET associative array. If you have a url like this page.php?id=5 then $_GET['id'] will contain the value of 5.
Always check input retrieved from urls so they match your specific criteria.