Re: Passing arguments to the same script

From: Date: Mon, 02 Dec 2002 04:09:45 +0000
Subject: Re: Passing arguments to the same script
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-126668@lists.php.net to get a copy of this message
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">
This string merely filles the $HTTP_SERVER_VARS["QUERY_STRING"] variable. So you should rather check to see if $HTTP_SERVER_VARS["QUERY_STRING"] equals 'questions', 'samples', etc... $_GET['var'] requires that the link look like this: <a href="index.php?page=samples"> You could then call $_GET['page'], which would contain the value samples. -- Kyle Gibson admin(at)frozenonline.com http://www.frozenonline.com/

« previous php.general (#126668) next »