Jump to content


Photo

header() + HTTP/1.1 Reponse Codes...


  • Please log in to reply
3 replies to this topic

#1 shiny_spoon

shiny_spoon
  • Members
  • PipPip
  • Member
  • 26 posts
  • LocationCanada

Posted 10 October 2006 - 02:31 PM

I'm trying to work with headers for a script I'm working on but it's giving me a hell of a time. At the very top of my PHP script I have
if($condition == TRUE){ header("HTTP/1.1 503 Service Unavailable"); }
but regardless of wether or not
$condition == TRUE
the page loads fine with no errors. I've even put the header code by itself and tried different status codes with the same results...

Do I have to configure something in php.ini or httpd.conf to make header status codes work!? Or am I just using the function incorrectly? ??? I've never had to use
header()
to forward response codes, so I'm a little bit clueless right now.

#2 Jenk

Jenk
  • Members
  • PipPipPip
  • Advanced Member
  • 778 posts

Posted 10 October 2006 - 02:35 PM

<?php

if($condition == TRUE)
{
    header("HTTP/1.1 503 Service Unavailable"); 
    die;
}

?>


#3 shiny_spoon

shiny_spoon
  • Members
  • PipPip
  • Member
  • 26 posts
  • LocationCanada

Posted 10 October 2006 - 02:40 PM

Thanks for the quick reply!

After trying with die; after header() as you suggested and with die(header()); I get a blank page with nothing in the page source and an empty error log... :-\

#4 shiny_spoon

shiny_spoon
  • Members
  • PipPip
  • Member
  • 26 posts
  • LocationCanada

Posted 11 October 2006 - 03:41 AM

Bump...




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users