Click to See Complete Forum and Search --> : URL Variables not being passed to code


segmental
05-01-2002, 03:52 PM
I've recently install apache 1.3 and php4.2 on my w2k box. Server runs and loads php, php works. The only problem I am having is that when i try to use a variable via the url the variable does not get passed to the program.
example:
www.url.edu/sort.php?job=new

results in $new not being set to anything.

I've tried this on production servers and the code is solid, I can only think there is a problem in the configuration for php or apache.

Any ideas?

segmental
05-01-2002, 04:28 PM
I found the solution, I'm putting it here for documentation purposes.

windows2000
c:\winnt\php.ini
register_globals = Off <- change to On

Anon
07-02-2002, 02:58 AM
I have the exact same problem with this combination and Win98 - and I was so proud of making it work. Also variables in a <form> with post or (I assume) any others are not passed.

Anon
07-02-2002, 03:07 AM
your solution worked, thanks

jJjJjJ
08-15-2002, 03:52 AM
register globals is not recommended to be 'on' as it means high potential for security problems.

Instead if you are passing variables on the URL such as
domain.com/page.php?date=today

leave register globals off and access it by:
$HTTP_GET_VARS['date']

piersk
08-15-2002, 05:55 AM
Originally posted by segmental
I've recently install apache 1.3 and php4.2 on my w2k box. Server runs and loads php, php works. The only problem I am having is that when i try to use a variable via the url the variable does not get passed to the program.
example:
www.url.edu/sort.php?job=new

results in $new not being set to anything.

I've tried this on production servers and the code is solid, I can only think there is a problem in the configuration for php or apache.

Any ideas?

I think you'll find the reason that you weren't getting anything in $new is because in the URL you gave above, the variable is $job, not new.