Passing data between pages
| From: | Becoming Digital | Date: | Tue, 27 May 2003 08:24:05 +0000 |
| Subject: | Passing data between pages | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-28073@lists.php.net to get a copy of this message | ||
I have a simple script that creates a series of links based on the results of a
query. As you can see from the code below, I am currently appending the query
info to the URL, but I don't believe this to be an ideal solution.
<?
$query = "SELECT * FROM categories ORDER BY cat_id";
$result = mysql_query( $query );
while ( $row = mysql_fetch_array( $result ) )
print "<a
href=\"display_items.php?cat_id=".$row['cat_id']."\">".$row['cat_name']."</a><br
/>\n";
?>
A search of numerous online resources and my collection of books leads me to
believe that I have two basic options: the first is to use a form, which I am
unsure of how to do with text links. The second is to implement sessions, which
I feel may be overkill. Overkill, that is, unless it's my only option. ;P
I look forward to all of your suggestions. I'm sure I'm overlooking something
that should otherwise be easy, so I apologize in advance. Thanks a lot.
Edward Dudlik
Becoming Digital
www.becomingdigital.com