RE: [PHP] Passing arguments to the same script
| From: | John W. Holmes | Date: | Mon, 02 Dec 2002 04:07:59 +0000 |
| Subject: | RE: [PHP] Passing arguments to the same script | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-126670@lists.php.net to get a copy of this message | ||
What PHP version are you using? Try $HTTP_GET_VARS['sample'] if it's an
older version. Also try index.php?sample=1, so that "sample" actually
has a value (although the method I gave you worked on IIS).
---John Holmes...
> -----Original Message-----
> From: Troy May [mailto:tmay@pcsympathy.com]
> Sent: Sunday, December 01, 2002 11:02 PM
> To: holmes072000@charter.net; 'PHP List'
> Subject: RE: [PHP] Passing arguments to the same script
>
> Thanks for responding. I think I'm still doing something wrong. Take
a
> peek:
>
> if(isset($_GET['questions'])) {
> echo "Questions link content will go here";
> }
> elseif(isset($_GET['samples'])) {
> echo "Samples link content will go here";
> }
> elseif(isset($_GET['rates'])) {
> echo "Rates link content will be here";
> }
> elseif(isset($_GET['contact'])) {
> echo "Contact information will go here.";
> } else {
> echo "Main content goes here.";
> }
>
> The only thing that EVER gets displayed is the final else. (Main
content
> goes here.) What am I doing wrong? Once again, the links are in this
> format: <a href="index.php?samples">
>
> Any ideas?
>
>
> -----Original Message-----
> From: John W. Holmes [mailto:holmes072000@charter.net]
> Sent: Sunday, December 01, 2002 7:39 PM
> To: 'Troy May'; 'PHP List'
> Subject: RE: [PHP] Passing arguments to the same script
>
>
> > I'm sure this is easy, but I'm drawing a blank. I need to have
links
> at
> > the
> > bottom of the page that passes arguments to the same script (itself)
> when
> > it
> > gets reloaded. How do we do this?
> >
> > I have the links like this now:
> >
> > <a href="index.php?samples">
> >
> > How do I determine what is passed? I need to do an "if" statement
> with
> > different outputs depending on the argument.
> >
> > if ($samples) { do something }
>
> if(isset($_GET['samples']))
> { do something }
>
> ---John Holmes...
>
>