Re: supernoob strikes again

From: Date: Sun, 09 May 2004 06:05:37 +0000
Subject: Re: supernoob strikes again
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-34325@lists.php.net to get a copy of this message
Dan Bowkley wrote:
Yeah, I'm back... I'm revamping my own site, finally...going for the same sort of dynamic system I was using for my last creation. Currently, I have index.php returning lots of different pages from a mysql database; what I'd like to do is have a somewhat more elegant solution for spitting back a 404 page.
I'm not entirely sure if I understand your problem, but I can try. It's a bit late. What you need is to test to see if 0 rows are returned. Do this before any HTML is outputted. You can use header("HTTP/1.0 404 Not Found") to tell the browser that the page wasn't found. You want to stop any output after that, too. If you use Apache, you can use a custom error document to give a pretty error page. See http://us4.php.net/manual/en/function.header.php http://httpd.apache.org/docs/mod/core.html#errordocument

« previous php.db (#34325) next »