[Sussex] PHP Help - Error Processing

Gareth Ablett Gareth.Ablett at itpserve.co.uk
Wed Jan 26 10:01:12 UTC 2005


 From: Steve Dobson [mailto:steve at dobson.org]
 Subject: [Sussex] PHP Help - Error Processing
> 
> Hi All
> 
> A little help on the best way to do some error handling.
> 
> I've implemented a user account system on my LAMP (Linux, Apache,
> MySQL, and PHP) server.  The user information includes a number
> of limits - I can code those no problem.  But how best to process
> the blocking of a user should a limit be passed?
> 
> I could just code up the PHP to generated a "Access Denied" page
> but I don't like that.  I would rather bounce the browser to
> an PHP generated error page.
> 
> I tried the following:
> 
>   if ($allowAccess) {
>      generatePage()
>   } else {
>      header("HTTP/1.1 403 Forbidden");
>   }
> 
> This generates a black page, and not a server generated error page
> like I expected.  I even tried "HTTP/1.1 404 Not Found" with the
> same results.
> 
> Okay PHP experts, can you tell me what I'm doing wrong?
> 

It would be easier to create a custom page and use 

header("Location: error.php");


The other thing is have you tried 1.0 instead of 1.1 it would depend on
what apache server version you are running.

Gareth Ablett
Systems Developer

ITP Services Ltd.
http://www.itpserve.co.uk/

------------------------------------------------------------------------
The recipient acknowledges that ITP Services Ltd is unable to control
the content of information in transmitting mail and attachments over the
Internet. ITP Services Ltd makes no warranty as to the quality,
accuracy and content of information contained in or with this message.
In
reading, opening or receiving this e-mail the recipient accepts full
responsibility for its content and attachments. 




More information about the Sussex mailing list