PHP Help...
Results 1 to 2 of 2

Thread: PHP Help...

  1. #1
    Banned
    Join Date
    Oct 2001
    Posts
    1,462

    PHP Help...

    Im working on a new site and I want to have a few tutorials.... But instead of having to link each chapter of the tutorial to a different URL I want to have a PHP script that will do it (in other words instead of linking to page2.html the script would be apache.php?page2) is this possible? I heard someone saying its Sectio0ns or something....
    Thanks in advance

  2. #2
    Hi mom!
    Join Date
    Aug 2001
    Posts
    1,103
    This works for me. In your example, your apache.php should have this content:
    Code:
    <?php
       header("location: page".$_GET["chapter"].".html");
    ?>
    If you now go to this page: apache.php?chapter=3
    you will end up showing: page3.html

    There's a working example here: http://80.60.89.26/~guus/apache.php
    http://80.60.89.26/~guus/apache.php?chapter=3 will bring you to page3.html

    I'm pretty new to php, so I'm not quite sure how this affect site security. Basically, you are giving users the opportunity to insert variables, so that can't be very good...

    Note that surfing to http://80.60.89.26/~guus/apache.php tries to forward you to page.html, since there isn't a variable 'chapter'. You could make your homepage/index here.
    I wish to express my gratitude to the people of Italy. Thank you for inventing pizza.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •