-
ok, here's what i need to do, it's really simple, except i don't know a lick about PHP...
i have this page, index.phtml...
it's my main page that will include the navigation bar..
and everything else is access throught this page by the
include (index.phtml?$page) where $page is the variable that tells the location of the page to include (i'm sure you know this)
anyway, i need a simple if and else command dealie that will make the page to inluclude main.html if ever the $page variable is not supplied..
________
i hope you guys understand what i'm talking about cause i really don't know how to speak PHP...
and i hope you guys help me
_
and yes, i know this is a flash boards but this is the only place i know where to ask :D
-
these are flash boards but we have no problem with other problems but we prefer requests like these to be kept to the scripting and backend forum.......
ANyway.......
Code:
if ($page){
//statements if $page variable exists
}else{
//statements to do if $page doesn't exist
include("main.html");
}
Hope this does the trick
-
-
You might want to read some really good threads at http://www.devshed.com when it comes to security, NEVER base your include's on a dynamic variable without checking if the $page is in a array of allowed pages that can be loaded into your site!
EX: index.phtml?$page=/private/etc/passwd
Guess what that does???
phpMyAdmin v 2.1 (I think) made that mistake, made my uni's server open to "whatever" you wanted to see:)
NuCleuZ
-
oooooooo I'd never thought of that.
Thaks for pointing that out.
-
The thread to read is:
http://forums.devshed.com/showthread.php?threadid=20525
Recomended to everyone that are conserned with server side security.
NuCleuZ