PHP Classes
elePHPant
Icontem

File: test.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  >  ICQ Status  >  test.php  >  Download  
File: test.php
Role: Example script
Content type: text/plain
Description: Test script
Class: ICQ Status
Check the online status of an ICQ user
Author: By
Last change:
Date: 10 years ago
Size: 1,522 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>CICQStatus Class Test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form action="" method="get" name="ICQStatus">
ICQ number: <input name="icq" type="text" value="<?php if (isset ($_GET["icq"])) { print ($_GET["icq"]); }?>"> <input name="submit" type="submit" value="Query">
</form>
<?php
include ("CICQStatus.php");

if (isset (
$_GET["icq"]))
{
   
$icqstatus = new CICQStatus ();
   
$status = $icqstatus->execute ($_GET["icq"], $errno, $errstr);
    if (
$status)
    {
        switch (
$status) {
            case
ICQ_ONLINE:
                print (
"ICQ " . $_GET["icq"] . " is online!");
                break;
            case
ICQ_OFFLINE:
                print (
"ICQ " . $_GET["icq"] . " is offline!");
                break;
            case
ICQ_WEBAWARE:
                print (
"ICQ " . $_GET["icq"] . " has the WebAware option disabled!");
                break;
        }
    }
    else
// if ($icqstatus->execute ($_GET["icq"], $errno, $errstr))
   
{
        print (
"An error occurred during ICQStatus query: <br />");
        print (
"Error n. " . $errno . ": " . $errstr);
    }
}
?>
</body>
</html>