RE: [PHP] Passing variables with a href hyperlinks
| From: | Jennifer Goodie | Date: | Fri, 25 Apr 2003 23:58:27 +0000 |
| Subject: | RE: [PHP] Passing variables with a href hyperlinks | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-145324@lists.php.net to get a copy of this message | ||
A GET is a type of request, just like POST. When stuff is tacked on to a
URL as a querystring (i.e. ?blah=1&grep=2) you have stuff in $_GET. Since
you are using $row['bguid'] for the label of you link, I am assuming that is
the value you want to pass.
so <a href=\"view_bug.php?bugid==$row[bugid]\">" . $row['bugid'] .
"</a></font></td> should work. And on view_bug.php the bug id will be in
$_GET[bugid] because you are passing it as a GET.
> -----Original Message-----
> From: Bobby Rahman [mailto:bobby_rahman2002@hotmail.com]
> Sent: Friday, April 25, 2003 4:54 PM
> To: php-general@lists.php.net
> Subject: [PHP] Passing variables with a href hyperlinks
>
>
>
> Hiya
>
> Im having troubles sending a page with a variable. I have tried numerous
> ways suggested by forums. Now its driving me mad.
>
> The situation:
> I have a page with a table where there is a column bugid. In the
> browser I
> can see all the bugids as hyperlinks which directs to view_page.php. Now
> when I press on the link It goes to the page but without the variable
> bugid....so there is no way of knowing which bugid I clicked on.
>
> this is the link that creates all the bugid as links:
>
> <a href=\"view_bug.php\">" . $row['bugid'] .
> "</a></font></td>
>
> now to get the variable bugid which has been selected I assume I
> need to use
> a question mark.
>
> <a href=\"view_bug.php?\">" . $row['bugid'] .
> "</a></font></td>
>
> now I want the bugid so put in:
> <a href=\"view_bug.php?bugid=$_GET['bugid']\">" .
> $row['bugid'] .
> "</a></font></td>
>
> But this doesnt return anything in the URL. If this worked I
> would expect to
> see something like this in the url view_bug.php?bugid="0000001"
>
> I think the problem is something to do with $row['bugid']...is
> there anyway
> I can GET what is stored in this?
>
> Any help would be very appreciated