Jump to content

Archived

This topic is now archived and is closed to further replies.

dancingbear

not parsing parameters

Recommended Posts

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?

Share this post


Link to post
Share on other sites
How are you accessing the [b]a[/b] URL paramter in your script?

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

Share this post


Link to post
Share on other sites

> 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?

Share this post


Link to post
Share on other sites
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.

Share this post


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

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.