Jump to content


Photo

not parsing parameters


  • Please log in to reply
4 replies to this topic

#1 dancingbear

dancingbear
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 10 October 2006 - 10:20 AM

Hi,

I have a webserver based php application that is working absolutely fine on a couple of servers.

I've recently put together a new server (using Fedora core 5 & apache), and although PHP works fine for 'bought' applications such as Invision Power Board, 'my' application isn't detecting the parameters passed to the application.

What I mean is this:-
- "www.domain.com/index.php" does what it's meant to.

- "www.domain.com/index.php?a=1" doesn't - it completely ignores the a=1 part (it cannot be detected by the script) and does just "www.domain.com/index.php" instead.

It's obviously related to the webserver setup in someway, but I have no idea what. Can anyone help please?

#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 10 October 2006 - 10:25 AM

How are you accessing the a URL paramter in your script?

The following should work:
echo $_GET['a']; // returns the value of a


#3 dancingbear

dancingbear
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 10 October 2006 - 10:50 AM


> How are you accessing the a URL paramter in your script?

with a simple:-

if ($a) {
  do this...
}

I'd much rather make any changes to the server config so that this still works done in this manner, rather than have to implement a new method to such as $_GET['a'] - I have around 200,000 lines of code in various php apps, and I don't much fancy having to trawl thru all these to make changes in scripts that currently work fine as they are.

Having said that, if there's very good reason to make the change then I will - is there a good reason?

#4 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 10 October 2006 - 01:54 PM

Turn on regitser_gloabls in then php.ini. Restart your server after you've made the changes though,

I do not recommend you to turn this setting on as it can cause security exploits in your code, thus why it is turn off by defeault. You should use the superglobals arrays ($_GET, $_POST, $_COOKIE etc). However most apps should work with this settting off anyway. If the app you are using requires this setting to be on then I would not recommend you to continue using that app.

#5 dancingbear

dancingbear
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 10 October 2006 - 02:00 PM

thanks - that appears to be the problem, so I guess I'll be having some fun re-coding scripts for the next few days. :(




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users