I need help cause I am a total newb on this.
I set up a session in my header:
session_start();
$_SESSION['catname'] = $catname;
Which I retrieve in my single pages:
$catname = $_SESSION['catname'];
session_destroy();
I have several divs, each with data type that can be used by jquery:
<div class="mydiv1" data-category="cat1"></div>
<div class="mydiv2" data-category="cat2></div>
Is it possible to use jquery on click function to get “cat1” and “cat2” from data-category and use this to supply $catname for my session variable?
Thank you!
I think you need to use ajax for this.
Maybe something like:
You will do the storing of session variable in the “file.php” by getting the catname.
Seems you have similar problem here: save-value-in-php-session-variable