|
 |
|
สอบถามเรื่อง ระบบอาจาย์ที่ปรึกษา โดยเริ่มจาก การล๊อคอินแล้วแยกแต่ละ สถานะ 4 สถานะ พร้อมลิงค์ไปยังเพจ ของแต่ละ สถานะด้วยครับ |
|
 |
|
|
 |
 |
|
Code (PHP)
<?php
$title="login system";
$dbhost="localhost";
$dbuser="root";
$dbpass="1234";
$c=mysql_connect($dbhost,$dbuser,$dbpass)or die(mysql_error());
mysql_query("set names 'tis620' ",$c);
mysql_select_db("project");
$sqlSelectLogin=mysql_query("select * from e_member where m_user='$m_user' and m_pass='$m_pass' ");
$rs=mysql_fetch_array($sqlSelectLogin);
?>
<!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=windows-874" />
<title><?php echo $title; ?></title>
<style>
body{margin:0px; font-family:"MS Sans Serif"; font-size:12px}
.border{border:solid 1px #CCCCCC;font-family:"MS Sans Serif"; font-size:14px;}
</style>
</head>
<body>
<p> </p>
<body>
<?php
if($rs['m_user']!="" || $rs['m_pass']!=""){
if($rs['m_status']=="1"){
$status="Administrator";
}else if ($rs['m_status']=="2"){
$status="teacher";
}else if ($rs['m_status']=="3"){
$status="parent";
}else{
$status="student";
}
echo"<table width=\"300\" border=\"0\" align=\"left\" class=\"border\">
<tr>
<td colspan=\"2\" bgcolor=\"#CCE6FF\"> Profile Form </td>
</tr>
<tr>
<td width=\"73\">No : </td>
<td width=\"215\">$rs[m_no]</td>
</tr>
<tr>
<td>ชื่อ-นามสกุล : </td>
<td>$rs[m_user]</td>
</tr>
<tr>
<td>รหัสประจำตัว : </td>
<td>$rs[m_pass]</td>
</tr>
<tr>
<td>สาขาวิชา : </td>
<td>$rs[m_branch]</td>
</tr>
<tr>
<td>สถานะ : </td>
<td>$status</td>
</tr>
<tr>
<td>ออกจากระบบ : </td>
<td><a href=\"index.php\">Logout</a></td>
</tr>
</table>";
}else{
echo "<center><font color=red>ข้อมูลไม่ถูกต้อง!</font></center>";
echo"<meta http-equiv=\"Refresh\" content=\"3;URL=index.php\" target='_parent'/>";
}
?>
</body>
</html>
|
 |
 |
 |
 |
Date :
2012-05-14 13:44:57 |
By :
arm |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 05
|