Page 1 of 1

retrieving the variable/value from the url HELP

Posted: Wed Jun 18, 2008 8:42 am
by glennn.php
having this url:

h**p://domain.com/file.php?message=this%20value ...

how can i retrive JUST the variable/value? - i realize $_SERVER['REQUEST_URI'] will get me the entire string after the .com/, but i need to get the variable's value (what's after the =) into a javascript...

i really appreciate the help,
GN

Re: retrieving the variable/value from the url HELP

Posted: Wed Jun 18, 2008 9:07 am
by nowaydown1
You want:

Code: Select all

 
$queryStringVar = $_GET["message"];
 
Which will give you the value of the 'message' parameter in your query string. Then you can just have PHP write out a little js if you need to pass it to javascript.

Re: retrieving the variable/value from the url HELP

Posted: Wed Jun 18, 2008 9:11 am
by glennn.php
awesome - actually, i knew the first part (i'm just an unthinking moron) but you helped me with the second issue - right, i can just have PHP echo a js function. cool.

awesome, again. thanks