Review your favorite Linux distribution.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 06-05-2009, 04:21 AM   #1
Registered: Feb 2009
Location: on the InterNET most hours of my life
Distribution: Ubuntu Server v8.04 / v11.10 & Mac OsX (mainly for FCP & video/audio)
Posts: 35

Rep: Reputation: 15
Question 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. . .
Old 06-05-2009, 07:59 AM   #2
Senior Member
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,304

Rep: Reputation: 345Reputation: 345Reputation: 345Reputation: 345

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.
Old 06-08-2009, 04:48 PM   #3
Registered: Feb 2009
Location: on the InterNET most hours of my life
Distribution: Ubuntu Server v8.04 / v11.10 & Mac OsX (mainly for FCP & video/audio)
Posts: 35

Original Poster
Rep: Reputation: 15
That was it - thanks much. . .

Nick. . .
Old 06-09-2009, 04:15 AM   #4
Wim Sturkenboom
Senior Member
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
If you don't have to update a few thousand source files, consider using e.g. $_GET['dBase']
Old 06-09-2009, 06:05 AM   #5
Registered: Sep 2007
Location: Berlin
Distribution: Slackware
Posts: 509

Rep: Reputation: 41
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...)


data, form, mysql, php, ubuntu

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Linux Carried Along on Netbooks Wave LXer Syndicated Linux News 0 10-21-2008 12:10 PM
KDE Session Not Carried forward swamprat Linux - Desktop 1 11-21-2007 01:19 PM
$_SERVER['QUERY_STRING']-php Manashi Programming 10 04-20-2006 05:01 PM
can i suspend the download carried out by apt (synaptic) amolgupta Linux - Software 1 06-02-2005 04:23 AM
how do i reformat my query_string in PHP? Alexander.s Programming 5 05-02-2005 11:12 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:16 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration