note 59861 deleted from function.header by aidan
| From: | aidan@php.net | Date: | Wed, 21 Dec 2005 07:11:04 +0000 |
| Subject: | note 59861 deleted from function.header by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-100503@lists.php.net to get a copy of this message | ||
Note Submitter: korbinian dot ober at gmail dot com
----
The $errcodes better do them like this:
$errcodes['400'] = 'HTTP/1.1 400 Bad Request';
$errcodes['401'] = 'HTTP/1.1 401 Unauthorized';
$errcodes['402'] = 'HTTP/1.1 402 Payment Required';
$errcodes['403'] = 'HTTP/1.1 403 Forbidden';
$errcodes['404'] = 'HTTP/1.1 404 Not Found';
$errcodes['405'] = 'HTTP/1.1 405 Method Not Allowed';
$errcodes['406'] = 'HTTP/1.1 406 Not Acceptable';
$errcodes['407'] = 'HTTP/1.1 407 Proxy Authentication Required';
$errcodes['408'] = 'HTTP/1.1 408 Request Timeout';
$errcodes['409'] = 'HTTP/1.1 409 Conflict';
$errcodes['410'] = 'HTTP/1.1 410 Gone';
$errcodes['411'] = 'HTTP/1.1 411 Length Required';
$errcodes['412'] = 'HTTP/1.1 412 Unless True';
$errcodes['500'] = 'HTTP/1.1 500 Internal Server Error';
$errcodes['501'] = 'HTTP/1.1 501 Not Implemented';
$errcodes['502'] = 'HTTP/1.1 502 Bad Gateway';
$errcodes['503'] = 'HTTP/1.1 503 Service Unavailable';
$errcodes['504'] = 'HTTP/1.1 504 Gateway Timeout';
and then:
header($errcodes['404']);
because otherwise you are initializing an array with 505 items and that takes time on a normal
webserver.