Ivan23
11-04-2006, 03:34 PM
Hello,
The how too file here in WHT is a little outdated
i like to create txt file and drop them in say "include" folder switch will auto create index.php?act=PAGE
Any updated how too will be great
thanks
HackNo-Alex
11-05-2006, 10:43 AM
well you can do:
if (empty($_GET['act'])) { require "includes/index.php"; }
elseif ($_GET['act'] == "PAGE') { require "includes/PAGE.php"; }
Keep adding elseif's for every page you want.
groomi
11-05-2006, 12:11 PM
The way I always do it is similar but it is:
if(empty($_GET['act'])){
include'include/index.txt';
}else{
include'include'.$_GET['act'].'.txt';
}
Ivan23
11-05-2006, 12:40 PM
The way I always do it is similar but it is:
if(empty($_GET['act'])){
include'include/index.txt';
}else{
include'include'.$_GET['act'].'.txt';
}
thats what i was looking for (works great)
now how can get to redirect back to home page if they use the wrong url
groomi
11-05-2006, 12:49 PM
thats what i was looking for (works great)
now how can get to redirect back to home page if they use the wrong url
for that i'd use .htaccess :P Create a file in your server root called ".htaccess" you may already have this file..
In it i'd put
ErrorDocument 404 /index.php
*edit* this will only work if you are using an apache server on linux
Ivan23
11-05-2006, 01:04 PM
ah i see what your saying, thank you
groomi
11-05-2006, 01:22 PM
no problem, hope it works :P
webeo
11-05-2006, 01:29 PM
I am using a index.php file with this code inside. The main.php is a default page displayed when "act" parameter is empty.
switch ($_GET['act']):
case "PAGE":
include("PAGE.php");
break;
case "PAGE1":
include("PAGE1.php");
break;
default:
include("main.php");
endswitch;