LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   PhP QUERY_STRING not being carried over ?? (https://www.linuxquestions.org/questions/programming-9/php-query_string-not-being-carried-over-730862/)

Nickalf 06-05-2009 04: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 ?

Code:

<HTML><head><TITLE>Test Access</TITLE></head>
<Body>
<h1>Testing</h1>

<?php
print "dBase=[$dBase] Name=[$Name]\n";
?>

</Body></html>

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


Thanks,
Nickalf. . .

Guttorm 06-05-2009 07:59 AM

Hi

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

Change
register_globals = Off
to
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 04:48 PM

That was it - thanks much. . .


:)
Nick. . .

Wim Sturkenboom 06-09-2009 04: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 06: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 10:10 AM.