i want to use url formatting like this:
index.php?page=pagename.htm
how do i pass "pagename.htm" to
include ("pagename.htm");
help using url formatting
Moderator: General Moderators
- dull1554
- Forum Regular
- Posts: 680
- Joined: Sat Nov 22, 2003 11:26 am
- Location: 42:21:35.359N, 76:02:20.688W
if your url looks like index.php?page=pagename.htm and you want to include pagename.htm do this
Code: Select all
include ($_GET['page']);- dull1554
- Forum Regular
- Posts: 680
- Joined: Sat Nov 22, 2003 11:26 am
- Location: 42:21:35.359N, 76:02:20.688W
how right you are feyd it would be a good idea to have an array of avaiable pages like this
Code: Select all
$array = array("blah.htm","somepage.htm","anypage.htm");
if (in_array($_GET['page'],$array)) include ($_GET['page']);
else echo "access denied";-
scrupul0us
- Forum Newbie
- Posts: 2
- Joined: Tue Aug 24, 2004 3:34 pm
hrm... when i try:
/index.php?page=question.htm
where it should be included just comes up blank...
heres the code:
<?php
$array = array("support.htm","question.htm","contact.htm","question.htm");
if (in_array($_GET['page'],$array)) include ($_GET['page']);
else echo "access denied";
?>
should also add that this php page is in:
/wwwroot/
and the htm pages are in:
/wwwroot/htm
/index.php?page=question.htm
where it should be included just comes up blank...
heres the code:
<?php
$array = array("support.htm","question.htm","contact.htm","question.htm");
if (in_array($_GET['page'],$array)) include ($_GET['page']);
else echo "access denied";
?>
should also add that this php page is in:
/wwwroot/
and the htm pages are in:
/wwwroot/htm