mod_rewrite and PHP register_globals

Oh, the strange things mod_rewrite does!

Postby phranck » Tue Jul 09, 2002 3:13 am

hi there,

using rewriting and php driven dynamic sites i have had a very esoteric phenomenon.
due to an update of php (4.2.1) my personal site, hostet at a local provider, stopped any execution of rewriting url's as the php option 'register_globals' is set to 'off' at version 4.2.1. everytime i clicked a link on my site nothing happens, neither an error-message nor rewriting.
the providers admin has set this option to 'on' and everything is fine...

is there anyone how can tell me about the
relations of this two sides...?
phranck
 
Posts: 1
Joined: Mon Jul 08, 2002 4:00 pm

Postby Brett » Mon Aug 05, 2002 12:52 pm

In theory, the register_globals directive should only affect the PHP scripts, not mod_rewrite. Is it possible that the rewriting still occurred and then PHP returned a blank page because the variables your script expected were all missing?
Brett
 
Posts: 82
Joined: Tue Jul 10, 2001 4:00 pm
Location: yohost.com

Postby Hervard » Wed Sep 15, 2004 10:23 pm

I've encountered this as well. Just installed Apache and PHP4 on my Windows machine today, and I'm still fiddling around with which settings to have on or off for both configurations.

I was making a mod_rewrite setting, so that if you went http://myhost.com/blah, it would be seen as http://myhost.com/a=$1, and PHP would then echo $a. This didn't work at all until I enabled the register_globals option. So it wasn't Apache at fault (like I thought it was at first), it was PHP's.
Hervard
 
Posts: 5
Joined: Wed Sep 15, 2004 10:08 pm
Location: New Zeleand

Postby Dan » Tue Jun 07, 2005 1:03 pm

As near as I can tell, you're trying to echo $a directly when, with register_globals off, you have to do echo $_GET['a']
Dan
 


Return to Idiosyncrasies

Who is online

Users browsing this forum: No registered users and 5 guests

cron