How to set SESSION variable from Jquery Trigger?

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
toplisek
Forum Commoner
Posts: 31
Joined: Tue Apr 11, 2006 1:23 pm

How to set SESSION variable from Jquery Trigger?

Post 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?
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: How to set SESSION variable from Jquery Trigger?

Post by Celauran »

Use a $.post() or $.get() call to execute the necessary PHP.
toplisek
Forum Commoner
Posts: 31
Joined: Tue Apr 11, 2006 1:23 pm

Re: How to set SESSION variable from Jquery Trigger?

Post by toplisek »

Need more help.
$_SESSION["var"] =;
How to set in my example $.post() into $_SESSION["var"]
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: How to set SESSION variable from Jquery Trigger?

Post by Celauran »

What are you trying to set and where is the value coming from?

jQuery.post() is probably worth looking at.
Post Reply