accessing vaues of previous page when next page is

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
bugthefixer
Forum Contributor
Posts: 118
Joined: Mon Mar 22, 2004 2:35 am

accessing vaues of previous page when next page is

Post 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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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'];

?>
Post Reply