hi
Assume i have directory structure like this
Folder
+ Modules
- FILES
To enable what you want to achieve we can use 2 tricks
1. Via FIle open and
2. Use simple Include
//.Code for index.php
// use a simple switch st.
switch($func)
{
case $func = "";
$default = "home.php";
break;
case $func = "portfolio";
$default = "portfolio.php";
break;
case $func = "downloads";
$default = "downloads.php";
break;
case $func = "resume";
$default = "resume.php";
break;
}
$path = "modules/$default";
// print $path;
$file = fopen ($path , 'r') or die("Couldnt open file");
$op = fread ($file , '1024') or die("Couldnt Read file");
print $op
Same thing could be achieved simply by use include instead of fopen as in
include modules/filename.
The basic idea is to enable the statement to find the variable
Hope this helps
Pradeep Dsouza
Aspbyte Creations.com