Page 1 of 1

accessing vaues of previous page when next page is

Posted: Fri Jun 18, 2004 12:46 am
by bugthefixer
my code in file is like this

Code: Select all

<a href="books.php" name="check">new book<a>
now i want to access this a tag name or other values of previous page in the page book.php...how can i do that

Posted: Fri Jun 18, 2004 12:56 am
by feyd
you'll have to pass them.. either through sessions, cookies, post or get...

since your example is a link, get is most suitable for this:

Code: Select all

&lt;a href="books.php?name=check"&gt;new book&lt;/a&gt;
and in book.php:

Code: Select all

<?php

if(isset($_GET['name']))
 echo $_GET['name'];

?>