-   Programming (
-   -   PhP QUERY_STRING not being carried over ?? (

Nickalf 06-05-2009 05:21 AM

PhP QUERY_STRING not being carried over ??
Hi Scripters,

I just installed a newer Ubuntu Distro and my dataBase readouts stopped working.

I tried a simple test URL/TestForDb.php?dBase=RENJ&Name=Test without success
and also tried the same as a FORM with both GET and POST

Any ideas why php would stop accepting data sent to it ?


<HTML><head><TITLE>Test Access</TITLE></head>

print "dBase=[$dBase] Name=[$Name]\n";


All I get is:
dBase=[] Name=[]

Nickalf. . .

Guttorm 06-05-2009 08:59 AM


They changed the default settings of "register_globals" in newer versions of PHP. It's usually safer to have it off, but lots of old scripts stop working.

Edit the file: /etc/php5/apache2/php.ini

register_globals = Off
register_globals = On

Then restart Apache. When register_globals is off, you find the posted values in _GET or _POST, or you can use _REQUEST which is a merge of the two.

Nickalf 06-08-2009 05:48 PM

That was it - thanks much. . .

Nick. . .

Wim Sturkenboom 06-09-2009 05:15 AM

If you don't have to update a few thousand source files, consider using e.g. $_GET['dBase']

Su-Shee 06-09-2009 07:05 AM

Wasn't register_globals one of the security issues and wouldn't it be much more useful NOT to set them on?

With a short script, it really doesn't matter wether or not you've got a few thousand files. (And usally just a handful handles requests directly anyway depending on your architecture...)

All times are GMT -5. The time now is 08:17 AM.