|
 |
|
พี่ๆครับ ช่วยเขียนโค้ดบันทึกข้อมูลลงฐานข้อมูล และโค้ดตรวจสอบว่าใครล๊อคอินเข้ามา ผมมือใหม่หัดเขียนครับ ทำแร้วแต่ไม่ได้ซักที ช่วยทีครับ |
|
 |
|
|
 |
 |
|



login.php
<?
@session_start();
?>
<html>
<head>
<style type="text/css">
<!--
.style2 {color: #00FF00}
-->
</style>
<body bgcolor="#FFFFFF" background="images/thinbarbkg.gif" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<form name="form1" method="post" action="index2.php?main=">
<table width="863" height="343" border="0" align="center">
<tr>
<td height="168" colspan="2"><div align="center" class="style2">
<p class="style3"><img src="icon/icon_login.png" width="60" height="60"></p>
<p class="style3">เข้าสู่ระบบ</p>
</div></td>
</tr>
<tr>
<td width="357" height="45"><div align="right" class="style3 style1 style2">ID:</div></td>
<td width="496"><input name="username" type="text" id="username"></td>
</tr>
<tr>
<td height="45"><div align="right" class="style3 style1 style2">Password:</div></td>
<td><input name="password" type="password" id="password"></td>
</tr>
<td height="75"><span class="style2"></span></td>
<td><input name="Login" type="submit" id="Login" value="Login"></td>
</table>
<p align="center"></p>
</form>
</body>
</html>
student_in.php
<?
@session_start();
?>
<html>
<head>
<style type="text/css">
<!--
.style2 {color: #00FF00}
-->
</style>
</head>
<body bgcolor="#FFFFFF" background="images/thinbarbkg.gif" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="MM_preloadImages('images/home2.jpg','images/teacherin2.jpg','images/memberin2.jpg','images/login2.jpg')">
<table width="863" height="430" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="">
<tr>
<td width="149" height="2" valign="top"> </td>
<td width="816" height="2" valign="top">
<div align="left">
<form name="form1" method="post" action="index2.php?main=Add_member">
<table width="592" border="0" align="center">
<tr>
<td colspan="2"><div align="center">
<p class="style2"><img src="icon/graduated.png" width="60" height="60"></p>
<p class="style2"><strong>-- นักศึกษาสมัครสมาชิก </strong>--</p>
</div></td>
<td width="119"> </td>
</tr>
<tr>
<td width="116"><div align="right" class="style2"><strong>ID :</strong></div></td>
<td width="343"><span class="style1">
<input name="username" type="text" id="username" size="15" maxlength="15">
**รหัสประจำตัวนักศึกษา**</span></td>
<td> </td>
</tr>
<tr>
<td><div align="right" class="style2"><strong>ชื่อ-สกุล :</strong></div></td>
<td><input name="name" type="text" id="name" size="50"></td>
<td> </td>
</tr>
<td><div align="right" class="style2"><strong>เลือกหมู่เรียน :</strong></div></td>
<td>
<div align="left">
<select name="section" id="section">
<option>-- เลือกหมู่เรียน --</option>
<?php
$sql = "SELECT * FROM section";
$db_query=mysql_db_query($dbname,$sql);
While($arr=mysql_fetch_array($db_query)){
?>
<option value="<?php echo $arr[id_section];?>"><?php echo $arr[name_section]?></option>
<?php }?>
</select>
</div></td>
<tr>
<td><div align="right" class="style2"><strong>ที่อยู่ :</strong></div></td>
<td><textarea name="address" cols="50" rows="3" id="address"></textarea></td>
<td> </td>
</tr>
<tr>
<td><div align="right" class="style2"><strong>โทรศัพท์:</strong></div></td>
<td><input name="tel" type="text" id="tel"></td>
<td> </td>
</tr>
<tr>
<td><div align="right" class="style2"><strong>Email :</strong></div></td>
<td><input name="email" type="text" id="email" size="50"></td>
<td> </td>
</tr>
<tr>
<td><div align="right" class="style2"><strong>Password :</strong></div></td>
<td><input name="password" type="password" id="password"></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td><div align="center">
<input type="submit" name="Submit1" value=" บันทึก ">
<input name="Reset" type="reset" value="ล้างข้อมูล">
</div></td>
<td> </td>
</tr>
</table>
<p> </p>
</form>
</div>
</tr>
</table>
</body>
</html>
teacher_in.php
<?
@session_start();
?>
<html>
<head>
<title>Free web templates.</title>
<!--BEGIN META TAGS-->
<META NAME="keywords" CONTENT=" templates, free templates,web template,download, sets, clipart, art, textures, gifs, backgrounds, pages, library, remotes, fantasy, 3d, cool, graphcis, homepage, buttons, bars, animated GIF's, bullets, backgrounds, clipart and stock photos.">
<META NAME="description" CONTENT="templates, free templates,web template,download, sets, clipart, art, textures, gifs, backgrounds, pages, library, remotes, fantasy, 3d, cool, graphcis, homepage, buttons, bars, animated GIF's, bullets, backgrounds, clipart and stock photos.">
<META NAME="rating" CONTENT="General">
<META NAME="ROBOTS" CONTENT="ALL">
<!--END META TAGS-->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<style type="text/css">
<!--
.style2 {color: #00FF00}
-->
</style>
</head>
<body bgcolor="#FFFFFF" background="images/thinbarbkg.gif" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="MM_preloadImages('images/home2.jpg','images/teacherin2.jpg','images/memberin2.jpg','images/login2.jpg')">
<table width="149" height="430" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="635" height="2" valign="top" bgcolor="">
<div align="left">
<form name="form1" method="post" action="index2.php?main=Add_techer">
<table width="575" border="0" align="center" bgcolor="">
<tr>
<td colspan="2"><div align="center">
<p class="style2"><img src="icon/teacher.png" width="60" height="60"></p>
<p class="style2"><strong>-- อาจารย์สมัครสมาชิก </strong>--</p>
</div></td>
<td width="104"> </td>
</tr>
<tr>
<td width="115"><div align="right" class="style2"><strong>ID :</strong></div></td>
<td width="342"><input name="username" type="text" id="username">
<span class="style1">**รหัสประจำตัวอาจารย์**</span></td>
<td> </td>
</tr>
<tr>
<td><div align="right" class="style2"><strong>ชื่อ-สกุล :</strong></div></td>
<td><input name="name" type="text" id="name" size="50"></td>
<td> </td>
</tr>
<td> </td>
<td> </td>
<tr>
<td><div align="right" class="style2"><strong>ที่อยู่ :</strong></div></td>
<td><textarea name="address" cols="50" rows="3" id="address"></textarea></td>
<td> </td>
</tr>
<tr>
<td><div align="right" class="style2"><strong>โทรศัพท์:</strong></div></td>
<td><input name="tel" type="text" id="tel"></td>
<td> </td>
</tr>
<tr>
<td><div align="right" class="style2"><strong>Email :</strong></div></td>
<td><input name="email" type="text" id="email" size="50"></td>
<td> </td>
</tr>
<tr>
<td><div align="right" class="style2"><strong>Password :</strong></div></td>
<td><input name="password" type="password" id="password"></td>
<td> </td>
</tr>
<tr>
<td><span class="style2"></span></td>
<td><div align="center" class="style2">
<input type="submit" name="Submit2" value=" บันทึก ">
<input name="Reset" type="reset" id="Reset" value="ล้างข้อมูล">
</div></td>
<td><span class="style2"></span></td>
</tr>
</table>
<p> </p>
</form>
</div>
</tr>
</table>
</body>
</html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
Tag : PHP, MySQL, CakePHP

|
|
 |
 |
 |
 |
Date :
2011-04-05 15:17:06 |
By :
FREEDOOM |
View :
965 |
Reply :
7 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ดันๆๆ
|
 |
 |
 |
 |
Date :
2011-04-05 15:44:34 |
By :
FREEDOOM |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
รอโปรแกรมเมอร์มาตอบให้ 
|
 |
 |
 |
 |
Date :
2011-04-06 15:42:32 |
By :
FREEDOOM |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ม่ายมีใครมาตอบเรย รอๆๆๆ
|
 |
 |
 |
 |
Date :
2011-04-06 17:39:53 |
By :
FREEDOOM |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ม่ายมีใครตอบเรย
|
 |
 |
 |
 |
Date :
2011-04-07 21:47:28 |
By :
FREEDOOM |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
จะบอกให้ว่าทำไมไม่ได้คำตอบ
1. ไม่ครอบ tag php
2. ยังไม่ได้ลองเขียนบันทึก
การขอให้คนเขียนให้ได้คำตอบยากกว่า เขียนแล้วเอามาให้ดูข้อผิดพลาด
บทเรียนมีให้อ่านครบทั้ง select, insert, update, delete
|
 |
 |
 |
 |
Date :
2011-04-08 01:15:22 |
By :
PlaKriM |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Thank 
|
 |
 |
 |
 |
Date :
2011-04-11 10:42:27 |
By :
fresg |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 01
|