<!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>Untitled Document</title> <style type="text/css"> <!-- body { background-color: #FFFF66; } --> </style></head> <body> มีการเช็คLoginที่หน้าlogin_check.php <form name="form1" action="login_check.php" method=''post'' onSubmit="return check()"> <table width="242" height="202" border="2" bordercolor="#993333" bgcolor="#9900FF"> <tr bgcolor="#66CCFF"> <td colspan="2" bordercolor="#000000"><div align="center"> <span class="style3">กรุณาใส่ชื่อและรหัสผ่าน</span></div> </td> </tr> <tr bgcolor="#66CCFF"> <td width="101" bordercolor="#000000"> <span class="style1">Username:</span> </td> <td width="136" bordercolor="#000000"> <span class="style1"> <input name="Username" type="text" size="13" maxlength="8" /> </span></td> </tr> <tr bgcolor="#66CCFF"> <td bordercolor="#000000"> <span class="style1">Password:</span> </td> <td bordercolor="#000000"><span class="style1"> <input name="Password" type="password" id="pass" size="15" maxlength="8" /> </span></td> </tr> <tr bgcolor="#66CCFF"> <td colspan="2" bordercolor="#000000"><div align="center"> <input type="submit" name="Submit" id="button" value="Login" /></div> </td> </tr> <tr bgcolor="#66CCFF"> <td colspan="2" bordercolor="#000000"><div align="center"> (<a href="condition.php" target="mainFrame">สมัครสมาชิก</a>)</div> </td> </tr> <tr bgcolor="#66CCFF"> <td colspan="2" bordercolor="#000000"><div align="center"> (<a href="forgetpass.php" target="mainFrame">ลืมรหัสผ่าน</a>)</div> </td> </tr> </table> <script language="javascript"> if(document.form1.getElementById(Username).value=="" && document.form1.getElementById(Password).value==""){ alert"กรุณาใส่ Username และ Password ของท่านด้วยค่ะ"; document.form1.Username.focus(); return false; }else if(document.form1.getElementById(Username).value!="" && document.form1.getElementById(Password).value==""){ alert"กรุณาใส่ Username ของท่านด้วยค่ะ"; document.form1.Username.focus(); return false; }else if(document.form1.getElementById(Username).value=="" && document.form1.getElementById(Password).value!=""){ alert"กรุณาใส่ Password ของท่านด้วยค่ะ"; document.form1.Password.focus(); return false; }else{ return true; } </script> </form> </body> </html>
<? if ($Username=="" && $Password=="") { echo "<h3>ERROR : กรุณากรอกข้อมูลให้ครบนะค่ะ<h3>"; exit(); } else{ include "connect.inc.php"; $result=mysql_query("select * from member where Username='$Username' and Password='$Password'",$conn); $num=mysql_num_rows($result); mysql_close(); } อยากให้ตอนที่ผู้ใช้Loginเข้าแล้วขึ้นหน้าMenuทั้งหน้าเลยค่ะ ทำไงค่ะ if($num>0) { //header("Location: menu.php"); echo "<meta http-equiv='refresh' content='0; URL = main2.php(main2.phpเป็นหน้าmainframeของหน้าmenu จะขึ้นที่หน้าLeftframeของหน้าLogin)' />"; } else { echo "<h3>ERROR : Username หรือ Password ไม่ถูกต้อง</h3>"; } ?>
<!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>Untitled Document</title> <style type="text/css"> <!-- body { background-color: #FFFF66; } --> </style></head> <body> <table width="777" height="295" border="2" align="center"> <tr bordercolor="#CC0033" bgcolor="#66CC99"> <td height="55" colspan="3"><div align="center"><img src="image/icons/home.png" alt="" width="22" height="22" /><span class="barmenu_bold"> หน้าเมนูหลัก</span></div></td> </tr> <tr bordercolor="#CC0033" bgcolor="#66CC99"> <td width="261" align="center"><div align="center"><a href="editwebsite.php" target="_parent"><img src="image/icons/Png/Harry Potter png/My documents.png" alt="" width="72" height="72" vspace="5" border="0" /><br /> แก้ไขเนื้อหาในเว็บ</a></div></td> <td width="233" align="center"><div align="center"><a href="template.php" target="_parent"><img src="image/icons/Png/Comic iPhone png/Browser.png" alt="" width="72" height="72" vspace="5" border="0" /><br /> รูปแบบเว็บไซค์</a></div></td> <td width="261" align="center"><div align="center"><a href="photo.php" target="_parent"><img src="image/icons/Png/Aire Mac png/JPEG File.png" alt="" width="72" height="72" vspace="5" border="0" /><br /> ระบบรูปภาพ </a></div></td> </tr> <tr bordercolor="#CC0033" bgcolor="#66CC99"> <td align="center"><div align="center"><a href="forgetpass.php" target="mainFrame"><img src="image/icons/Icon/ChristmasTimeFullpack/ChristmasTime Icon 18.png" alt="" width="72" height="72" vspace="5" border="0" /><br /> เปลี่ยนรหัสผ่าน</a></div></td> <td align="center" class="normalcolor"><div align="center"><a href="manaul1.php" target="_blank"><img src="image/icons/Png/Sketchy icons png/ultralingua.png" alt="" width="72" height="72" vspace="5" border="0" /><br /> คู่มือการใช้งานเบื้องต้น </a></div></td> <td align="center"><div align="center"><a href="logout.php" target="_parent"><img src="image/icons/exit.png" alt="" width="72" height="72" vspace="5" border="0" /><br /> ออกจากระบบ </a></div></td> </tr> </table> </body> </html>
โค้ด login_check.php <? if ($Username=="" && $Password=="") { echo "<h3>ERROR : กรุณากรอกข้อมูลให้ครบนะค่ะ<h3>"; exit(); }else{ include "connect.inc.php"; $result=mysql_query("select * from member where Username='$Username' and Password='$Password'",$conn); $num=mysql_num_rows($result); if($num>0) { session_start(); session_register("Fn"); $row=mysql_fetch_array($re); $_SESSION['Fn'] = $row['Username']; header("Location:main2.php"); }else { echo "<h3>ERROR : Username หรือ Password ไม่ถูกต้อง</h3>"; } } ?>
<frameset rows="*" cols="80,*" frameborder="NO" border="0" framespacing="0"> <frame src="login.php" name="L" > <frameset rows="80,*" frameborder="NO" border="0" framespacing="0"> <frame src="top.php" name="t"> <? session_start(); if($_SESSION['Fn'] ==""){ ?> <frame src="first.php" name="M"> <? }else{?> <frame src="menu.php" name="M"> <? }?> </frameset> </frameset> <noframes>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง