This works for me. In your example, your apache.php should have this content:
If you now go to this page: apache.php?chapter=3Code:<?php header("location: page".$_GET["chapter"].".html"); ?>
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.





Reply With Quote