|
|
|
อยากทราบโค้ด แสดงสถานะ Msn Online ครับ อยากทราบโค้ด แสดงสถานะ Msn Online ครับ |
|
|
|
|
|
|
|
I'taw-*-tinGtonG
|
|
|
|
|
Date :
2009-04-14 01:42:07 |
By :
26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!!!ตึก ม.บูรพา ถล่ม น่ากลัว[font=Verdana]จังว่ะ[/font]!!!
|
|
|
|
|
Date :
2010-08-17 13:42:02 |
By :
poo |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
รัก
|
|
|
|
|
Date :
2011-01-25 22:01:08 |
By :
ทท |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ไม่รู้ใช่แบบที่ต้องการป่าวนะ ลองเอาไปดูละกัน
index.html
Code (PHP)
<html>
<head>
<title>MSN Status Checker 1.0b</title>
</head>
<body>
<form method="post" action="msn.php">
MSN : <input type="text" name="get" size="30" maxlength="80">
<input type="submit" name="Submit" value="<< C h e c k">
</form>
</body>
</html>
msn.php
Code (PHP)
<?
$msn[Host] = "207.46.106.175"; //MSN server
$msn[Port] = 1863; // MSN port
$msn[user] = "your_msn_account"; // Second MSN screenname
$msn[Pass] = "xxxxxx"; // password
$pic[offline] = "msnoff.png"; // Relative path to msnoff.png
$pic[online] = "msnon.png"; // Relative path to msnon.png
if (!$get){?>
<html>
<head>
</head>
<body>
<img src="<? echo $pic[offline]; ?>" border="0" name="msn">
</body>
</html>
<?
exit;
}
msn_connect();
function msn_connect() {
global $debug, $msn, $nr, $fp; $nr = 0;
if($debug) {
echo "<p><b>Connecting to msn $msn[Host]:$msn[Port]</b><br>";
}
if($fp = fsockopen ($msn[Host], $msn[Port], $errno, $errstr, 30))
{msn_send("VER $nr MSNP7 CVRO",$fp);
while (!feof($fp)) {
usleep(1);
if (msn_get(ereg_replace("\r\n", "", fgets($fp,128))) == "1") {
die(blieb);
};
}}
else {
die("cannot connect to msn server");
}}
function msn_send($text, $conn) {
global $debug;
if ($debug) {
echo "<font color=\"red\">$text</font><br>\n";
}
fputs ($conn, "$text\r\n");
global $nr;$nr++; }
function msn_get($msg) {
global $fp, $nr, $msn, $debug, $fp2;
if ($debug) {
echo "<font color=\"blue\">$msg</font><br>\n";
}
$msg = explode(" ", $msg);
if (strtolower($msg[0]) == "ver") {
msn_send("INF $nr", $fp);
}
elseif(strtolower($msg[0]) == "inf") {
msn_send("USR $nr MD5 I $msn[user]", $fp);
}
elseif (strtolower($msg[0]) == "usr" AND strtolower($msg[2]) == "md5") {
msn_send("USR $nr MD5 S ".MD5(trim($msg[4].$msn[Pass])), $fp);
}
elseif (strtolower($msg[0]) == "usr" AND strtolower($msg[2]) == "ok") {
msn_send("CHG $nr BSY", $fp);
msn_send("XFR $nr SB", $fp);
}
elseif (strtolower($msg[0]) == "xfr" AND strtolower($msg[2]) == "ns") {
$tmp = explode(":", $msg[3]);
$msn[Host] = $tmp[0];
$msn[Port] = $tmp[1];
fclose($fp);
msn_connect();
}
elseif (strtolower($msg[0]) == "xfr" AND strtolower($msg[2]) == "sb") {
$tmp = explode(":", $msg[3]);
$msn[sb_host] = $tmp[0];
$msn[sb_port] = $tmp[1];
$msn[sb_cki] = $msg[5];
fclose($fp);
if($debug) {
echo "<p><b>Connecting to sb $msn[sb_host]:$msn[sb_port]</b><br>";
}
if($fp2 = fsockopen ($msn[sb_host], $msn[sb_port], $errno, $errstr, 30)){
$start = time()+5;
msn_send("USR $nr $msn[user] $msn[sb_cki]",$fp2);
while (!feof($fp2)) {
if (time() >= $start) {
showstatus(0);
exit;
}
usleep(1);
msn_sb_get(ereg_replace("\r\n", "", fgets($fp2,128)));
} }
else { die("cannot connect to sb"); }
}}
function msn_sb_get($msg) {
global $fp2, $nr, $msn, $debug, $get;
if ($debug) {
echo "<font color=\"green\">$msg</font><br>\n";
}
$msg = explode(" ", $msg);
if (strtolower($msg[0]) == "usr" AND strtolower($msg[2]) == "ok") {
msn_send("CAL $nr $get",$fp2);
}
elseif (strtolower($msg[0]) == "217") {
showstatus(0);
fclose($fp2);
exit;
}
elseif (strtolower($msg[0]) == "joi") {
showstatus(1);
fclose($fp2);
exit;
} }
function showstatus($status) {
global $pic,$get;
if ($status) {
@header("Location: status.php?msn=$get&status=online");
} else {
@header("Location: status.php?msn=$get&status=offline");
}
}?>
status.php
Code (PHP)
[php]<?php
echo "MSN : $msn ";
if($status=="online") {
echo "<img src='msnon.png'>";
} else {
echo "<img src='msnoff.png'>";
}
?>
[/php]
|
|
|
|
|
Date :
2011-01-26 09:40:50 |
By :
Dragons_first |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 04
|