Do a phpinfo() and check to see if you  perhaps have a cookie with the
name "id" set with the value "1".  If your look at variables_order in your
php.ini file, you will see that cookie data will override get-method data.
To force a read from the GET data, use $_GET['id'] instead of $id.

-Rasmus

On Sun, 3 Mar 2002, Chris N wrote:

> Ive just found a rather weird bug that im experiencing. Im running PHP 4.1.2
> with Apache 1.3.23 on Linux Redhat 7. When ever I try and use variable $id
> it always has a value of 1 no matter what. It only does it if its in a get,
> think a post too. I can hard code it in a script and itll have a correct
> value but in a GET it gets messed up. Ive tried running it several ways of
> having it be first in the list or last, no matter what its always 1.
>
> Example:
> url = http://www.domain.com/test.php?id=12345&name=Kalamazoo
>
> File :
> <?php
> echo "name = $name<br>";
> echo "id = $id<br>";
> echo "<a href=\"$PHP_SELF?id=12345&name=Kalamazoo\">click</a>";
> ?>
>
> Result :
> name = Kalamazoo
> id = 1
> click ( http://www.domain.com/test.php?id=12345&name=Kalamazoo )
>
> Anyone have any ideas what this could come from?
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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

Reply via email to