[Sussex] PHP Help - Error Processing

Steve Dobson steve at dobson.org
Wed Jan 26 09:42:14 UTC 2005


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?

Steve




More information about the Sussex mailing list