Re: How is this possible? [Solved]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tedd wrote:
> At 2:48 PM -0400 10/28/09, Robert Cummings wrote:
>> Bob McConnell wrote:
>>> From: tedd
>>>
>>>> I found the problem, which basically was that I had declared a
>>>> variable in a preceding script with the same name, namely $user_id.
>>>>
>>>> When I changed my script to $u_id, everything worked as before.
>>>> Clearly, Globals are evil.
>>>>
>>>> It's a bitch to have to work with code you can't change unless you
>>>> are willing to edit over 1500 files.
>>>
>>> Just keep in mind that register_globals is deprecated and will be going
>>> away in a future release of PHP. You might want to start thinking about
>>> a strategy to update those files before that happens.
>>>
>>> Bob McConnell
>>
>> I don't think his problem was register_globals, I think it was the
>> other problem of globals... namely variable naming collision causing
>> value clobber.
>>
>> Cheers,
>> Rob.
> 
> 
> Rob:
> 
> You were exactly right -- it was a collision.
> 
> Now, if I can only find out why header("location:.."); stopped working.
> 
> Sometimes old code presents a lot of problems to solve.
> 
> Thanks,
> 
> tedd
> 

I would use headers_sent() to find out if the headers have been sent before
calling header()


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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux