is it possible to store a variable through javascript so that I can read it in php using $_REQUEST[‘variable_name’].
for eg.
let’s say i have
$adcategory=$_REQUEST['category_id'];
somewhere in the php page, and I would like to pre set that “variable” somewhere before that in javascript, so that it could be read through php.
Does this make any sense? Is this possible?
Thank you for your time!
Andrej
It’s less of a technical problem, more of how you structure your code and interaction between the PHP backend and in-page Javascript.
To get the $category_id variable into Javascript, the typical approach is:
To have your Javascript code send a catid back to a PHP page:
This would ping it back to PHPs $_REQEUST[] array. But the question is why you need the variable available in Javascript first.