LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 06-05-2009, 04:21 AM   #1
Nickalf
Member
 
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 ?

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

Rep: Reputation: 218Reputation: 218Reputation: 218
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.
 
Old 06-08-2009, 04:48 PM   #3
Nickalf
Member
 
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
Su-Shee
Member
 
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...)
 
  


Reply

Tags
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


All times are GMT -5. The time now is 09:01 AM.

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