• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

PHP Problem

WebWatcher

New Member
Ok I have a link that looks like this:

http://mydomain.com/index.php?act=Arcade

now at the top of the page I have the following..

if($act=='Arcade'){
}else{
header("Location: home.php");
die();
}

But for some reason it doesn't continue to load when i go to the direct link it does the redirect.

I did work up until I upgraded my php version.

Can somebody please assist ASAP

Regards
 
probably register_globals is off now ...

PHP:
if($_GET['act'] == 'Arcade'){
}else{
header("Location: home.php");
die();
}
 
i know, it must be because register_global is turned off.

if you want to enable register global for this directory only, create a .htaccess in the directory which contains the file:
Code:
php_flag register_globals on

or edit the php.ini change the "register_globals = Off" setting into "register_globals = On"

Actually, krakjoe's suggestion is better. however, if you have a lot of php files with the same coding style, and if you're too lazy to edit one-by-one, then just use mine because enabling register_globals usually put some risks.
 
Last edited:
Back
Top