|
Posted by sunnyboyGuo on 01/09/08 12:30
On Jan 9, 6:16 pm, Janwillem Borleffs <j...@jwscripts.com> wrote:
> sunnyboy...@gmail.com schreef:
>
> > How can I catch this exception and use header function to write header
> > information?
>
> Which PHP version are you using? With PHP5 you can use try/catch:
>
> try {
> // do what you want to do} catch (Exception $ex) {
>
> Header("http/1.1 500 Internal Server Error");
>
> }
>
> With PHP4, when the error is non-fatal, you can surpress the error
> message by prepending an at sign (@) before the functional call.
>
> JW
sorry, my environment is php5.0.
when there occured some error, it will send headers automatically, so
i can not use header() to send expected header information.
it will prompt message like this:
<br />
<b>Warning</b>: Cannot modify header information - headers already
sent by (output started at /var/www/tpms.php:155) in <b>/var/www/
tpms.php</b> on line <b>25</b><br />
can i control it not send automatically, and to send myself header
information?
best regards,
Tony
Navigation:
[Reply to this message]
|