LogicOpinion
02-13-2008, 12:01 PM
hello, i am about to ask several quiestions about:
how is link like: ..../index.php?page=1§or=2 made ?
i thought about this and did something like this:
<?php
$p = &$_REQUEST['p'];
if (!file_exists("navigation/".$p.".php"))
{ include "main.php"; next;}
else
{ if (isset($p) && $p!='main') { include "navigation/".$p.".php"; }
else
{ include "main.php"; }
}
?>
and as a rool it works fine..
but i found as i thought a hole in this way of building page:
now what is that..: as you see all included files (which are filename.php) are kept in the FOLDER named NAVIGATION
and if someone will edit URL
http://somehostname.com/index.php?p=5 instead of this will type http://somehostname.com/navigation/filename.php the content of that page will be desplayed..
i checked such thing on several websites ... but none of them let me see that file (included file)
mybe i got wrong to use inclusion and desplaying pages dinamicaly?
or maybe there is no problem if someone can view that page outside of page ..... like
someurl.com/somefoldername/subfoldername/filename.php?
please give me some advice. thank you
how is link like: ..../index.php?page=1§or=2 made ?
i thought about this and did something like this:
<?php
$p = &$_REQUEST['p'];
if (!file_exists("navigation/".$p.".php"))
{ include "main.php"; next;}
else
{ if (isset($p) && $p!='main') { include "navigation/".$p.".php"; }
else
{ include "main.php"; }
}
?>
and as a rool it works fine..
but i found as i thought a hole in this way of building page:
now what is that..: as you see all included files (which are filename.php) are kept in the FOLDER named NAVIGATION
and if someone will edit URL
http://somehostname.com/index.php?p=5 instead of this will type http://somehostname.com/navigation/filename.php the content of that page will be desplayed..
i checked such thing on several websites ... but none of them let me see that file (included file)
mybe i got wrong to use inclusion and desplaying pages dinamicaly?
or maybe there is no problem if someone can view that page outside of page ..... like
someurl.com/somefoldername/subfoldername/filename.php?
please give me some advice. thank you