php query strings..?.

Out of context: Reply #3

  • Started
  • Last post
  • 9 Responses
  • oculasm0

    your question is quite clear, this might help. its basically a combination of ifs and includes.

    a more efficient way of doing it would be with case statements.. anyhow here you go:

    <html>
    <head><title>Welcome...
    <body>
    <?

    $page = $_GET["page"];
    //this gets the query string from the url!
    if (($page == "home")
    {
    echo ("Home page goes here.");
    }
    else if($page == "about")
    {
    echo ("About page goes here.");
    //you can put your include statement here
    include('about.htm');
    }
    ?>
    </body>
    </html>

View thread