<?php
/*
* This script was writed by Setec Astronomy - setec@freemail.it
*
* This script is distributed under the GPL License
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* http://www.gnu.org/licenses/gpl.txt
*
*/
?>
<html>
<head>
<title>CYahooStatus Class Test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form action="" method="get" name="CYahooStatus">
Yahoo! account name: <input name="yahoo" type="text" value="<?php if (isset ($_GET["yahoo"])) { print ($_GET["yahoo"]); }?>"> <input name="submit" type="submit" value="Query">
</form>
<?php
include ("CYahooStatus.php");
if (isset ($_GET["yahoo"]))
{
$yahoostatus = new CYahooStatus ();
$status = $yahoostatus->execute ($_GET["yahoo"], $errno, $errstr);
if ($status !== false)
{
switch ($status) {
case YAHOO_ONLINE:
print ("Yahoo! " . $_GET["yahoo"] . " is online!");
break;
case YAHOO_OFFLINE:
print ("Yahoo! " . $_GET["yahoo"] . " is offline!");
break;
case YAHOO_UNKNOWN:
print ("Yahoo! " . $_GET["yahoo"] . " is in an unknown status!");
break;
}
}
else // if ($status)
{
print ("An error occurred during CYahooStatus query: <br />");
print ("Error n. " . $errno . ": " . $errstr);
}
}
?>
</body>
</html>
|