Ehsan Ehsan - 3 months ago 9
PHP Question

Retrive query strings of previous page

assume we click on a

link
in page
page1.php?id=1
and go to
page2.php
.
My question is that: How can I retrieve value of
id
on
page1.php
in
page2.php
?

Answer

In page1.php set the id value in a $_SESSION['pageid']=$_GET['id']

den retrive $_SESSION['pageid'] in page2.php and as soon as u access the id value unset the session unset($_SESSION['pageid'])