NYCPHP Meetup

NYPHP.org

[nycphp-talk] why does setcookie fail?????

Patrick Hunt pat at vote.com
Sat Sep 6 16:48:02 EDT 2003


you changed from $row['nnet_user_registrationnumber'] to $row[0].

I'd bet that the name of column 0 in the sql resulset isn't
'nnet_user_registrationnumber'

----------------------------------------------

On Sat, 6 Sep 2003 16:43:48 -0400, Phil Powell wrote:

>Well this is how I solved it:
>
>if ($hasLoggedIn && ($row = mysql_fetch_row($query)) {
> setcookie('nordicnet_registration', $row[0], 0, '/');
> ...
>}
>
>That works!! Apparently the problem was neither setcookie nor header, AND it
>was BOTH!
>
>Figure that one out, geniuses!!! ;)
>
>Phil
>----- Original Message ----- 
>From: "Brian Pang" <bpang at bpang.com>
>To: "NYPHP Talk" <talk at lists.nyphp.org>
>Sent: Saturday, September 06, 2003 4:38 PM
>Subject: Re: [nycphp-talk] why does setcookie fail?????
>
>
>> it's quite possible that $row['nnet_user_registrationnumber'] null, but
>> my cookie was set with a value of
>> {}
>>
>> which is not null, though probably not what was expected.
>> but would indicate that the var was null/empty/undefined/false
>>
>> > 2. I suspect the real problem is that
>> > $row['nnet_user_registrationnumber'] is null. That would definitely
>> > make the browser discard the cookie.
>>
>> _______________________________________________
>> talk mailing list
>> talk at lists.nyphp.org
>> http://lists.nyphp.org/mailman/listinfo/talk
>
>_______________________________________________
>talk mailing list
>talk at lists.nyphp.org
>http://lists.nyphp.org/mailman/listinfo/talk
>





More information about the talk mailing list