|
|
|
เรื่อง Login เข้าหน้า Menu ค่ะ หน้านี้คือ หน้าLogin ตัวLoginจะอยู่ทาง Left frame นะค่ะ |
|
|
|
|
|
|
|
จริงๆ ถ้าเป็นผมนะ ผมจะแยก left manu, header, footer เป็นคนละไฟล์
แล้วก็ include เข้ามา จากนั้นก็ เช็ค session ว่า มีการ login หรือยัง
ถ้ายัง ให้ใชว์ form ให้ login ถ้า login แล้วก็ให้ โชว์ "ไม่ต้องการเว็บไซต์ คลิกนี่"
ส่วน code นั้น ลองค้นดูครับ น่าจะมีเยอะ หรือ ไม่ก็รอ rep ล่างครับ
เผื่อมีวิธีที่ดีว่านี้
|
|
|
|
|
Date :
2009-10-27 14:25:57 |
By :
ICrazyMan |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ขอไฟล์ main2.php มาดูหน่อยครับ
|
|
|
|
|
Date :
2009-10-27 14:38:18 |
By :
Sek-Artdrinker |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
หน้าโค้ด main2.php
Code (PHP)
<!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>
|
|
|
|
|
Date :
2009-10-27 14:44:20 |
By :
bigpig310 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
โค้ดข้างบนหน้าเมนู นิ
อะ ม่าเปงราย
Code (PHP)
โค้ด 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>";
}
}
?>
หน้า main2.php ที่ใช้เฟรมอะ
Code (PHP)
<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>
น่าจะประมานนี้นะครับ
|
|
|
|
|
Date :
2009-10-27 15:24:46 |
By :
Sek-Artdrinker |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ปกติผมทำลักษณะนี้ครับไม่แน่ใจว่าจะมีแบบผมไหมนะครับ
คือผมจะแบ่งเป็นส่วนๆ เวลาที่เราจะทำหน้าต่อไป ผมก็ copy หน้าปัจจุบัน แล้ว แก้ไขที่ ตรง ที่เราจะสั่ง คิวรี่เอาครับ
|
|
|
|
|
Date :
2009-10-28 09:49:20 |
By :
tingtongkub |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 03
|