Le Mercredi 2 Octobre 2002 10:06, Ernani Joppert Pontes Martins a écrit :

> Yes I know that you can't send headers to the browser when you've already
> sent some other stuffs, but ASP users have strange feeling that this is
> weird.

That's not a PHP problem, but deals with headers and page standardization. ASP 
users should deal with standards.

> Can't we implement some procedure that checks if Cookies and session
> commands were specified in the wrong way and automatically fix this for the
> ASP wrong programmers?
>
> If we found some cookies and session parameters on the entire script, can
> php intend to send this values to the browser w/o send that warning message
> ?

Sounds like you did not RTFM (Read This Fine Manual) in PHP docs. If you want 
those cookies and other header stuff be transparently manipulated, you can:
1) Enable output buffering in PHP.INI
2) Use direct output buffering functions as discussed in Output Control 
Functions in PHP manual.

When using output buffering, the whole body is buffered and cached while 
headers are set. This is the straight answer to your problem.
But, when you don't want to buffer the page, you have to deal by yourself with 
headers, as no buffering is sending right away whatever is printed to the 
browser.

> This procedure should minimize most common problems to bring PHP as the
> most Strong server side scripting language used in the entire internet.
>
> I am not a ASP fan, I had this problems while I was trying to bring more
> people to PHP and quit to implement Microsoft ASP solutions.

As stated above, this procedure exists, and is there for quite some time now. 
Maybe the biggest problem is developpers not wanting RTFM and imagining PHP 
should be ASP and have the same syntax, the same bugs and [add whatever you 
want]. This is quite the wrong way of thinking, exactly as if you asked C to 
be syntaxically equivalent to Basic.

DJ Anubis.



--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to