Forum Moderators: coopster
$foo = "$d";// foo is equal to the d varible
if($foo == "") {// if foo is equal to nothing
$dir ="_pages";// then $dir is _pages
}
else {// else
$dir = "$d";// $dir is equal to $d varible
}
$page = "$p.inc";// page is equal to the p varible
if($page == ".inc") {// if page is equal to nothing
$content = "home.inc";// then $content is $dir/homes.inc
$counter = "1";// & visitor counter is called
}
else {// else
$content = "$page";// $content is equal to $dir/$page varibles
}
// which means is the string is?d=_incl&p=page1
// then $content should be page1.inc in the _incl
// folder ( _incl/page1.inc )
Now I want to test that the include specified in the string exists, and if it doesn't that it includes an error page.
I've tried having a go with my novice skills but I'm getting parse errors.
if (is_file("$incl") {
include($incl);
}
else {
include(_incl/error.inc);
} Also tried using "file_exists" instead of "is_file".
On an added note is this going to cause much server slow down checking for the file?
I note that the pre and code tags here dont seem to work either..
[edited by: jatar_k at 4:19 pm (utc) on Jan. 14, 2004]
[edit reason] fixed sidescroll [/edit]