[PHP] not passing arguments from HTTP GET?

2002-09-11 Thread Mark Setzer

Hi all,

I am running PHP 4.2.2 on Apache 1.3.26 under MacOS X 10.2. My scripts' 
functionality seems to have gone amok, and while I am not sure this is 
the fault of php directly, I was hoping someone could help me track 
down the problem.

Basically, if I have a script that I pass arguments to on a get 
request, the argument seems to be processed (ie, it is found in 
$_SERVER[argv][0]), but the actual argument itself has no effect. For 
example, I have a script that checks for a date variable:

if ($date) { print $date; }

and when I call it by loading http://www.../date.php?date=2002-09-11 - 
the script produces nothing, even though the argv(0) is 
date=2002-09-11. What's at fault here, any ideas? I am using a binary 
distro (it's linked from the php site) for OSX, but I've used it in the 
past and never encountered such a problem. Other PHP functionality 
seems fine, so I don't think my webserver is in error. The code seems 
ridiculously simple.

Head-scratcher.

Thanks for any help,
Mark


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] not passing arguments from HTTP GET?

2002-09-11 Thread Jay Blanchard

[snip]
I am running PHP 4.2.2 on Apache 1.3.26 under MacOS X 10.2. My scripts'
functionality seems to have gone amok, and while I am not sure this is
the fault of php directly, I was hoping someone could help me track
down the problem.

Basically, if I have a script that I pass arguments to on a get
request, the argument seems to be processed (ie, it is found in
$_SERVER[argv][0]), but the actual argument itself has no effect. For
example, I have a script that checks for a date variable:

if ($date) { print $date; }

and when I call it by loading http://www.../date.php?date=2002-09-11 -
the script produces nothing, even though the argv(0) is
date=2002-09-11. What's at fault here, any ideas? I am using a binary
distro (it's linked from the php site) for OSX, but I've used it in the
past and never encountered such a problem. Other PHP functionality
seems fine, so I don't think my webserver is in error. The code seems
ridiculously simple.
[/snip]

Check the status of register_globals in your php.ini . If it is off, get
variables are available from $_GET['variable_name'] such as $_GET['date'].

You could choose to turn register_variables ON (it used to be on by default
in earlier versions of PHP) or you could choose to turn it on in an
.htaccess directive by folder since you're running Apache.

HTH!

Jay

*
* Texas PHP Developers Conf  Spring 2003*
* T Bar M Resort  Conference Center*
* New Braunfels, Texas  *
* Contact [EMAIL PROTECTED]   *
*   *
* Want to present a paper or workshop? Contact now! *
*



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php