<?php session_start(); mysql_connect("localhost","root","12345678"); mysql_select_db("config"); $strSQL = "SELECT * FROM member WHERE Username = '".mysql_real_escape_string($_POST['txtUsername'])."' and Password = '".mysql_real_escape_string($_POST['txtPassword'])."'"; $objQuery = mysql_query($strSQL); $objResult = mysql_fetch_array($objQuery); if(!$objResult) { echo "Username and Password Incorrect!"; } else { $_SESSION["ID"] = $objResult["ID"]; $_SESSION["Status"] = $objResult["Status"]; session_write_close(); if($objResult["Status"] == "ADMIN") { header("location:admin_page.php"); } else if($objResult["Allow"] == "Enable") { header("location:index2.php"); } else{ header("location:login.php");} } mysql_close(); ?>
<meta charset="UTF-8"> <?php include('admin_page.php'); $strSQL = "SELECT * FROM member WHERE ID = '".$_SESSION['ID']."' "; $objQuery = mysql_query($strSQL); $objResult = mysql_fetch_array($objQuery); echo "<table border='1' align='center' width='500'>"; echo "<tr align='center' bgcolor='#CCCCCC'><td>ID</td><td>Uername</td><td>Password</td><td>Name</td><td>Department</td><td>Phone <td>Status</td><td>Allow</td></td><td>แก้ไข</td><td>ลบ</td></tr>"; while($row = mysql_query($strSQL)) { echo "<tr>"; echo "<td>" .$row["ID"] . "</td> "; echo "<td>" .$row["Username"] . "</td> "; echo "<td>" .$row["Password"] . "</td> "; echo "<td>" .$row["Name"] . "</td> "; echo "<td>" .$row["Department"] . "</td> "; echo "<td>" .$row["Phone"] . "</td> "; echo "<td>" .$row["Status"] . "</td> "; echo "<td>" .$row["Allow"] . "</td> "; echo "<td><a href='UserUpdateForm.php?ID=$row[0]'>edit</a></td> "; echo "<td><a href='UserDelete.php?ID=$row[0]' onclick=\"return confirm('Do you want to delete this record? !!!')\">del</a></td> "; echo "</tr>"; } echo "</table>"; mysqli_close($strSQL); ?>
<html> <head> <title>Cattelecom</title> </head> <body> <?php $objConnect = mysql_connect("localhost","root","12345678") or die("Error Connect to Database"); $objDB = mysql_select_db("config"); $strSQL = "SELECT * FROM member"; $objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]"); ?> <table width="600" border="1"> <tr> <th width="91"> <div align="center">ID</div></th> <th width="98"> <div align="center">Username </div></th> <th width="198"> <div align="center">Password </div></th> <th width="97"> <div align="center">Name </div></th> <th width="59"> <div align="center">Department </div></th> <th width="71"> <div align="center">Phone </div></th> <th width="76"> <div align="center">Status </div></th> <th width="75"> <div align="center">Allow </div></th> </tr> <?php while($objResult = mysql_fetch_array($objQuery)) { ?> <tr> <td><div align="center"><?php echo $objResult["ID"];?></div></td> <td><?php echo $objResult["Username"];?></td> <td><?php echo $objResult["Password"];?></td> <td><div align="center"><?php echo $objResult["Name"];?></div></td> <td align="right"><?php echo $objResult["Department"];?></td> <td align="right"><?php echo $objResult["Phone"];?></td> <td align="right"><?php echo $objResult["Status"];?></td> <td align="right"><?php echo $objResult["Allow"];?></td> </tr> <?php } ?> </table> <?php mysql_close($objConnect); ?> </body> </html>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง