Re: Force a 404 error?

2002-05-17 Thread Helios de Creisquer

On Thu, May 16, 2002 at 11:40:49AM +0100, Jonathan M. Hollin wrote:
 Hi JAPHs,
 
 Is it possible to force a 404-error from within a mod_perl CGI?
 
 I am working on my CMS and I want to generate a 404 if the user hacks
 the URI in a certain way: i.e, if the use passes a value in the URI that
 does reference a database record.  I can (and have) trapped such an
 event and thus I can display the appropriate Not found warning by
 using a CGI.pm redirect to my 404 page, but using redirect obviously
 updates the URL (as displayed on the browsers address line) to that of
 the 404 page, whereas I want the URL to continue to display the users
 request.
 
 Can I do this?

See:

http://archive.covalent.net/modperl/2001/04/0088.xml

Cheers,
-- 
   Helios de Creisquer  [EMAIL PROTECTED]
http://www.tuxfamily.org/[EMAIL PROTECTED]
http://www.vhffs.org/  +33 (0)6 70 71 20 29  [EMAIL PROTECTED]
http://www.gnu.org/[EMAIL PROTECTED]
GPG(1024D/96EB1C44): FB11 8B80 4D86 D9C2 DE0C 11D7 2FA8 A5CC 96EB 1C44



returning HTTP error code

2001-04-05 Thread Helios de Creisquer

Hi !

I've got a mod_perl script calling an external program which
use much memory. And I would like to send a 503 instead of
calling this external program when there is less than xxxMB
of memory free.

Is mod_perl provides this ability to decide to send 
an HTTP return code or another ?

Thx for your answers...

Cheers.
-- 
Helios de Creisquer
mail: [EMAIL PROTECTED]



Re: returning HTTP error code

2001-04-05 Thread Helios de Creisquer

"Jeffrey W. Baker" wrote:
 sub handler {
 my $r = shift;
 $r-status(503);
 $r-send_http_header;
 
 return OK; #or return SERVER_ERROR; depends on how want to do it.
 }

Wow, pretty simple, in fact, thx a lot ! :-)

Cheers.
-- 
Helios     de Creisquer
mail: [EMAIL PROTECTED]