PHP Classes
elePHPant
Icontem

File: sample.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Setec Astronomy  >  Yahoo Status  >  sample.php  >  Download  
File: sample.php
Role: Example script
Content type: text/plain
Description: Sample file
Class: Yahoo Status
Get the online status of a Yahoo! messenger user
Author: By
Last change:
Date: 10 years ago
Size: 1,534 bytes
 

Contents

Class file image Download
<?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>