Re: http response 200
| From: | Daniel Brown | Date: | Fri, 20 Jun 2008 19:57:51 +0000 |
| Subject: | Re: http response 200 | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-275736@lists.php.net to get a copy of this message | ||
On Fri, Jun 20, 2008 at 5:35 AM, joaquinbordado <ryangacusana@gmail.com> wrote:
>
> 'm a total newbie..i just want to know how can i display an http response 200
> with this message "message successfully sent" ...here is my code
HTTP code 200 just means OK. Any successful location and serving
of a web file will result in HTTP 200.
> <?php
> if ($status == "RETEMP02")
> echo "Mobile number is empty.";
> elseif ($status == "RETEMP03")
> echo "Message is empty.";
> elseif ($status == "RETEMP05")
> echo "Message Id is empty.";
> elseif ($status == "RETVAL03")
> echo "Invalid mobile number.";
> elseif ($status == "RETVAL04")
> echo "Mobile number not recognized.";
> elseif ($status == "RETVAL05")
> echo "Message is containing illegal character.";
> elseif ($status == "")
> echo "Message sending failed";
> else
> echo "Message has been sent successfully.";
> ?>
My preference here would be:
<?php
if ($status == "RETEMP02") {
echo "Mobile number is empty.";
} elseif ($status == "RETEMP03") {
echo "Message is empty.";
} elseif ($status == "RETEMP05") {
echo "Message Id is empty.";
} elseif ($status == "RETVAL03") {
echo "Invalid mobile number.";
} elseif ($status == "RETVAL04") {
echo "Mobile number not recognized.";
} elseif ($status == "RETVAL05") {
echo "Message is containing illegal character.";
} elseif ($status == "") {
echo "Message sending failed";
} else {
echo "Message has been sent successfully.";
}
?>
In any case, regardless of what message is echoed out from above,
it will give an HTTP 200/OK response.
--
</Daniel P. Brown>
Dedicated Servers - Intel 2.4GHz w/2TB bandwidth/mo. starting at just
$59.99/mo. with no contract!
Dedicated servers, VPS, and hosting from $2.50/mo.