Possible Duplicate:
Ajax, javascript send variable to another page, on click
Hello,
Lets say i have 3 divs:
<div id="section1">
<? $var='value1'; ?>
<a href="mysite.com/page1">page1</a>
</div>
<div id="section2">
<? $var='value2'; ?>
<a href="mysite.com/page2">page2</a>
</div>
<div id="section3">
<? $var='value3'; ?>
<a href="mysite.com/page1">page3</a>
</div>
Using jquery, javascript, ajax and not php (get, session variable) can i do this?
If i click on the link to page1 send $var=’value1′ to page1
If i click on the link to page2 send $var=’value2′ to page2
If i click on the link to page3 send $var=’value3′ to page3
Thank you!
I’m not sure exactly what you’re asking, but it sounds like you just want to supply the values on the query string to the destination pages:
Then in each of those pages you’d use
$_GET['var']to access the variable in the PHP code, or access the query string from JavaScript directly.