Re: http response 200

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jun 20, 2008 at 5:35 AM, joaquinbordado <ryangacusana@xxxxxxxxx> 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.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux