Forum Moderators: coopster

Message Too Old, No Replies

having trouble passing variable

         

urbley

3:24 pm on Nov 21, 2004 (gmt 0)

10+ Year Member



i need to pass a variable in a php echo "<script>parent.location='page2.php';</script>"; line. and in the php in the next code i need to use this variable.. does anyone know how i could do this? the data for the variable is irrelovant... it's just like a little flag piece of data that says the person got to the second page from the first and is not directly linkin to it.

Hope someone can help cos i'm absolutely stumped on this one!

Thanks.

Steve

Birdman

5:08 pm on Nov 21, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You could add a GET parameter to the URL:

echo "<script>parent.location='page2.php?ref=1';</script>";

...Then, in the parent window's script(page2.php), look for the GET var:

if(isset($_GET['ref']) && $_GET['ref'] == 1){
...yes, they came from the correct script...
}

urbley

4:33 pm on Nov 22, 2004 (gmt 0)

10+ Year Member



Awesome thanks! worked a treat.