-1
這裏是我的代碼如果登錄嘗試回顯連接,使用身份驗證的IRC登錄會發送到NICKSERV?
<html>
<title></title>
<body>
<form method="get" >
Username: <input type="text" name="user"><br>
Password: <input type="password" name="pwd"><br>
<input type="submit" value="Submit">
</form>
<?php
//konfig
$server = "XXXX";
$port = "XXXX";
$enable_password = true;
//error
error_reporting(0);
if (isset($_GET['user']) && isset($_GET['pwd'])) {
$username = $_GET['user'];
$password = $_GET['pwd'];
if (($username !== "") && ($password !== "")) {
set_time_limit(30);
if (!($socket = fsockopen($server, $port, $errno, $errstr, 10))) {
echo "Cant Connect Server";
flush();
} else {
if ($enable_password)
fputs($socket, "USER " . $username . "\n");
fputs($socket, "PASS " . $password . "\n");
//get $line
$line = @fgets($socket, 1024);
if (strstr($line, "Authentication successful. You are now Login")) {
echo "Connected";
} else {
echo "Not Connected";
}
}
}
}
?>
</body>
襪子裝在我的PHP。 我嘗試,並輸出未連接,而用戶名和密碼爲真。 它需要通過發送/ msg NICKSERV標識[passwd]來識別用戶名和密碼。 任何想法如何將該命令添加到我的腳本?和輸出的希望結果是正確的,而我輸入用戶名和密碼..
確定我會嘗試通過配置添加到陣列... – user2328538 2013-05-04 14:21:25
感謝建議 – user2328538 2013-05-04 14:21:26