Page 1 of 1

How to set SESSION variable from Jquery Trigger?

Posted: Tue Jan 31, 2012 3:56 am
by toplisek
How to set SESSION variable from Jquery Trigger?
I have set trigger link like:
<script type="text/javascript">
$(document).ready(function(){
$(".trigger").click(function(){
$(".panel").toggle("slow");
$(this).toggleClass("active");
return false;
});
});
</script>

How to solve this trigger into SESSION (PHP) to manipulate further in the correct way?

Re: How to set SESSION variable from Jquery Trigger?

Posted: Tue Jan 31, 2012 5:32 am
by Celauran
Use a $.post() or $.get() call to execute the necessary PHP.

Re: How to set SESSION variable from Jquery Trigger?

Posted: Tue Jan 31, 2012 5:40 am
by toplisek
Need more help.
$_SESSION["var"] =;
How to set in my example $.post() into $_SESSION["var"]

Re: How to set SESSION variable from Jquery Trigger?

Posted: Tue Jan 31, 2012 5:46 am
by Celauran
What are you trying to set and where is the value coming from?

jQuery.post() is probably worth looking at.