| Server IP : 182.53.201.61 / Your IP : 216.73.217.175 Web Server : Apache/2.2.15 (Fedora) System : Linux km10.dyndns.org 2.6.31.5-127.fc12.i686.PAE #1 SMP Sat Nov 7 21:25:57 EST 2009 i686 User : apache ( 48) PHP Version : 5.3.3 Disable Function : NONE MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/test/ |
Upload File : |
<?php session_start();?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ระบบเงินเดือน</title>
</head>
<body>
<?php
// Url ที่จะไปต่อ บริการที่ port 80 จึงไม่ต้องการ Port
if (isset($_POST['target'])) $webServer=$_POST['target'];
else $webServer=$_SERVER['HTTP_HOST'];
if ($webServer =='10.0.1.10' ||$webServer =='10.0.2.10') $webxxb = substr($webServer,0,-2)."2"; //10.0.1.7 หรือ 10.0.2.7
else {
if ($webServer =='192.168.1.100' || $webServer =='192.168.2.100') $webxxb = substr($webServer,0,-3)."2"; //192.168.1.7 หรือ 192.168.2.7
else {
$port = strpos($webServer,':');
if ($port) $webxxb = substr($webServer ,0,$port);
else $webxxb=$webServer;
}
}
if (isset($_POST['username'])) {
$usr = trim($_POST['username']);
if ($usr == '') echo
"<script>
alert('ต้อง LOGIN ผู้ใช้');
window.location = href='javascript:history.back(1);';
</script>";
else {
$AuthServer = '192.168.1.14';
$port = 81;
if(($sock = socket_create(AF_INET, SOCK_DGRAM, 0)))
{
$input = 'ChkUsr'.$usr.'#'.trim($_POST['password']);
if (socket_sendto($sock, $input , strlen($input) , 0 , $AuthServer , $port))
//if (socket_recv ( $sock , $reply , 2045 , MSG_WAITALL ) ) $_SESSION['Login'] = iconv("utf-8","tis-620",$reply); //UTF8 to tis-620
if (socket_recv ( $sock , $reply , 2045 , MSG_WAITALL ) ) $_SESSION['Login'] = $reply; //UTF8 to tis-620
}
}
if ($_SESSION['Login'] =='UnAuth')
echo
"<script>
alert('ชื่อผู้ใช้หรือรหัสผ่านไม่ถูกต้อง');
window.location = href='javascript:history.back(1);';
</script>";
else {
//$_SESSION['Login'] = iconv("utf-8","tis-620",str_replace(';','@',substr($_SESSION['Login'],10)) );
$_SESSION['Login'] = iconv("utf-8","tis-620",substr($_SESSION['Login'],10));
header('Location://'.$webxxb.'/test/nursing.php?&code='.$_SESSION['Login'] );
//echo $_SESSION['Login'];
//header('Location://'.$webxxb.'/salary/index.php?&code='.base64_encode($_SESSION['Login']) );
//header('Location://'.$webxxb.'/salary/index.php?code='.utf8_decode($_SESSION['Login']) );
exit(0);
}
}
?>
</body>
</html>