[PHP & Apache] .htaccess & register globals nightmare

statik213

Golden Member
Oct 31, 2004
1,654
0
0
Ok,
I've written a bunch of code assuming register globals are on. BUt the server that the site I did is going to be hosted on has register globals enabled by default. This sucks big time 'cos in a few of my scripts (previously) local variables ending up binding to session vars and screw things up. Now i don't want to waste time rewriting php code.....

Now, I googled and found out that .htaccess can solve this problem I tried the following as my .htaccss (I chmod'd it to 644 as well)

Code:
php_flag register_globals off
Order allow,deny
Allow from all

And get this error


Code:
Server error!

    The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script. 

    If you think this is a server error, please contact the Web Services 

Error 500

    xx.xx.edu
    Wed 09 Feb 2005 06:44:05 PM EST
    Apache/2.0.46 (Red Hat

Now this would work if AllowOverride Option was enabled for this account. I don't know how to confirm that this is the problem. Now, everyone is probably screaming email the system admin..... well the system admins are reeally really slow to react, they will take at least 3 weeks to respond to this (if at all)....

How can I work around this (w/o rewriting a whole lot of code)? Is there some php trick?

Or is there some other .htaccess trick? I know that some 'AllowOverride's like AuthConfig is turned on because I'm using that to control access to some site administration folders....

Any help would be greatly appreciated.



added the poll for fun, hope it doesn't offend anyone :)