We help IT Professionals succeed at work.

construct querystring, PHP Jquery

swordfishsoup
on
Hi.
I have a Jquery page linked to a PHP file - in the Jquery section I need to have a function that launches a separate page.

All is fine I just need to set a GET value for the receiving page and I don't know how to do this.

Without any query the code is: $('#contentholder').load("paper.php");

I would like to append to the address the value of a session variable called frmpack

so paper.php?pack=(the session value). Just not sure how to do it.

I do have a hidden div with the session stored and a class of hiddenpack - so I can get the value with Jquery if that helps - may be a long way round....

Thanks
Comment
Watch Question

Commented:
what is the format of hidden div which stores the session value...?!

Author

Commented:
It's just a div with css  display - None. I can use the class name to get the value.
I don't know how to just get a value of a session variable another way?

Author

Commented:
in the div I just echo the session variable
Commented:
Try this..

$('#contentholder').load("paper.php?pack="+$('#div_id').html());

where I assumed div_id to be the id of the div where you echo the session value...


Hope this helps..

--
yruz

Author

Commented:
Thanks - good idea but doesn't seem to pass the GET to the page. Any other suggestions?
Can I quote the Session value directly in Jquery do you know?

Author

Commented:
Hi, Sorry - it does work - I cleared cash and restart session and it's fine. It must have been confused with all my attempts.
Thanks for your help.