Help for a php newbie

  • Ok i was just wondering how to do something:

    I would like to use a query string to separate pages, for example, same script, different page as in:

    http://www.yoursite.com/script.php?action=thispage

    I know how do do this in perl, how would i do it in php?


  • Thanks for the help!


  • I'm far from a PHP guru, but use something like this:

    if ($action == "page1") {
    ?>
    HTML Here

    }

    if ($action == "page2") {
    ?>
    HTML Here

    }
    ?>


  • If you mean splitting search-results or something, you can generate a mysql-query like this:

    $query = "SELECT $yourfields FROM $yourtables WHERE $whereClause LIMIT $offset, $maxhits";

    this will return the query result from the $offset's row until $offset+$maxhits

    // do something with the query

    Then you can split them by passing the offset and maxhits throught the link, something like next page







  • #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about Help for a php newbie , Please add it free.