 |
insert ไม่ลง database ครับ...insert into member (mem_firstname,mem_lastname, |
|
 |
|
|
 |
 |
|
register.php
<?
$arrProvince ="select * from province";
$resProvince = mysql_query($arrProvince,$conn);
?>
<? if($_GET['action'] == "") {?>
<script type="text/javascript" SRC="js/Validate.js"></script>
<h3>สมัครสมาชิก(Register)</h3>
<br>
<br>
<h4> สร้าง Username และ Password</h4>
<form name="form1" id="form1" method="post" action="?name=user&file=register" onsubmit="return checkForm()">
<table border="0">
<tr>
<td>Username:</td>
<td>
<input type="text" name="username" id="username" value="<? echo $_SESSION['regis']['username'];?>" maxlength="15"/>
<font color="#FF0000">* เป็นตัวอักษรหรือตัวเลข ความยาวไม่เกิน 15 ตัว</font></td>
</tr>
<tr>
<td>Password:</td>
<td>
<input type="password" name="password" id="password" maxlength="10"/>
<font color="#FF0000">* เป็นตัวอักษรหรือตัวเลข ความยาวไม่เกิน 10 ตัว</font></td>
</tr>
<tr>
<td>Re_password:</td>
<td>
<input type="password" name="repassword" id="repassword" maxlength="10"/>
<font color="#FF0000">* ยืนยันรหัสผ่าน</font></td>
</tr>
</table>
<br>
<h4>ข้อมูลส่วนตัว </h4>
<table width="481" height="317" border="0">
<tr>
<td width="148">ชื่อ:</td>
<td width="317">
<input type="text" name="firstname" id="firstname" value="<? echo $_SESSION['regis']['firstname'];?>"/>
<font color="#FF0000">*</font></td>
</tr>
<tr>
<td>นามสกุล:</td>
<td>
<input type="text" name="lastname" id="lastname" value="<? echo $_SESSION['regis']['lastname'];?>" />
<font color="#FF0000">*</font></td>
</tr>
<tr>
<td>เพศ:</td>
<td>
<input name="gender" type="radio" value="ผู้ชาย" id="rdo1"/> ผู้ชาย
<input name="gender" type="radio" value="ผู้หญิง" id="rdo2"/> ผู้หญิง
<font color="#FF0000">*</font></td>
</tr>
<tr>
<td>Email:</td>
<td>
<input type="text" name="email" id="email" value="<? echo $_SESSION['regis']['email'];?>"/>
<font color="#FF0000">*</font></td>
</tr>
<tr>
<td>ที่อยู่:</td>
<td>
<textarea name="address" rows="10" cols="40" id="address"><? echo $_SESSION['regis']['address'];?></textarea><font color="#FF0000">*</font>
</td>
</tr>
<tr>
<td height="74">จังหวัด:</td>
<td>
<select name="province_id">
<option value="--"> </option>
<? while($resData = mysql_fetch_array($resProvince)){ ?>
<option value="<?=$resData['province_id']?>"><? echo($resData['province_name']);?></option>
<? }?>
</select>
<font color="#FF0000">*</font></td>
</tr>
<tr>
<td>รหัสไปรษณีย์:</td>
<td>
<input type="text" name="zipcode" maxlength="6" id="zipcode" size="6"value="<? echo $_SESSION['regis']['zipcode'];?>" onKeyUp="IsNumeric(this.value,this)"/>
<font color="#FF0000">* เป็นตัวเลขเท่านั้น</font></td>
</tr>
<tr>
<td>เบอร์โทรศัพท์:</td>
<td>
<input type="text" name="tel" maxlength="9" id="tel" size="9"value="<? echo $_SESSION['regis']['tel'];?>" onKeyUp="IsNumeric(this.value,this)"/>
<font color="#FF0000">เป็นตัวเลขเท่านั้น</font></td>
</tr>
<tr>
<td>เบอร์มือถือ:</td>
<td>
<input type="text" name="mobile" maxlength="10" size="10" id="mobile" value="<? echo $_SESSION['regis']['mobile'];?>" onKeyUp="IsNumeric(this.value,this)"/>
<font color="#FF0000">* เป็นตัวเลขเท่านั้น</font></td>
</tr>
<tr>
<td colspan="3"><div align="center" class="style1"><b>หมายเหตุ ฟอร์มที่มีเครื่องหมาย (<font color="#FF0000">*</font>) ด้องใส่ข้อมูลทุกฟอร์ม </b></div></td>
</tr>
</table>
<p>
<br>
<input type="submit" name="Submit" value="ตกลง" />
<input type="reset" name="Submit2" value="ยกเลิก" />
</p>
</form>
<p>
<? } elseif($_GET['action'] == "register") {
$_SESSION['regis'] = $_POST;
//echo "<pre>"; print_r($_POST);
$firstname = ($_POST['firstname']);
$lastname = ($_POST['lastname']);
$gender = ($_POST['gender']);
$email = ($_POST['email']);
$address = ($_POST['address']);
$province = ($_POST['province']);
$zipcode = ($_POST['zipcode']);
$tel = ($_POST['tel']);
$mobile = ($_POST['mobile']);
}else{
$password = md5($_POST['password']);
//เช็คค่าที่กรอกใน Username ถ้าซ้ำขึ้น Error
$str="select * from member where username ='".$_POST['username']."' ";
$result = mysql_query($str,$conn);
$res = mysql_num_rows($result);
if ($res){
$msg="ชื่อ Username ซ้ำ กรุณาเปลี่ยนใหม่";
$_SESSION['msg']= $msg;
echo "<script type='text/javascript'>";
echo "location.href='?name=user&file=register' ";
echo "</script>";
}else{
// ทำการ insert ข้อมูล ลงในตาราง Member
$strSQL="insert into member (mem_firstname,mem_lastname,gender,mem_email,mem_address,province_id,zipcode,mem_tel,mem_mobile,username,password)";
$strSQL .="values('".$_POST['firstname']."','".$_POST['lastname']."','".$_POST['gender']."','".$_POST['email']."' ,'".$_POST['address']."' ,'".$_POST['province_id']."','".$_POST['zipcode']."','".$_POST['tel']."','".$_POST['mobile']."' ,'".$_POST['username']."' ,'".$password."')";
//echo $strSQL;
mysql_query($strSQL,$conn);
mysql_close($conn);
}
?>
<center>
<h4>ข้อมูลถูกบันทึกแล้ว</h4><br>
<a href="index.php?name=user&file=login">Login </a> </center>
<? } ?>
Tag : - - - -
|
|
 |
 |
 |
 |
Date :
2009-12-07 00:25:16 |
By :
อยากเก่ง |
View :
1798 |
Reply :
19 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (PHP)
// ทำการ insert ข้อมูล ลงในตาราง Member
136.
$strSQL="insert into member (firstname,lastname,gender,email,address,province_id,zipcode,tel,mobile,username,password)";
$strSQL .="values('".$_POST['firstname']."','".$_POST['lastname']."','".$_POST['gender']."','".$_POST['email']."' ,'".$_POST['address']."' ,
'".$_POST['province_id']."','".$_POST['zipcode']."','".$_POST['tel']."','".$_POST['mobile']."' ,'".$_POST['username']."' ,'".$password."')";
mysql_query($strSQL);
}
|
 |
 |
 |
 |
Date :
2009-12-07 00:35:12 |
By :
nottpoo |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ผมต้องการดูว่า error มัน คืออะไรครับ
ใส่แล้วเอา error ที่มันแสดงมาให้ดูหน่อยครับ
|
 |
 |
 |
 |
Date :
2009-12-07 00:37:21 |
By :
DownsTream |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ไม่ได้อยู่ดีอะครับ พี่ครับ
|
 |
 |
 |
 |
Date :
2009-12-07 00:39:21 |
By :
อยากเก่ง |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
มันเด้งขึ้นมาหน้าเดิมอะครับ
ไม่เเสดงerrorอะไรเลย
|
 |
 |
 |
 |
Date :
2009-12-07 00:42:56 |
By :
อยากเก่ง |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ถ้าอย่างนั้น มันก็ไม่เข้า เงื่อนไข insert สิครับ
ลอง print_r($_GET);
ดูครับว่ามีตัวแปร GET ส่งมาบ้าง
|
 |
 |
 |
 |
Date :
2009-12-07 00:50:43 |
By :
DownsTream |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ถ้ายังไม่ได้ก็ลองลบบ้างส่วนออกดูครับเพื่อได้
Code (PHP)
$strSQL="insert into member";
$strSQL .="values('".$_POST['firstname']."','".$_POST['lastname']."','".$_POST['gender']."','".$_POST['email']."' ,'".$_POST['address']."' ,
'".$_POST['province_id']."','".$_POST['zipcode']."','".$_POST['tel']."','".$_POST['mobile']."' ,'".$_POST['username']."' ,'".$password."')";
mysql_query($strSQL);
|
 |
 |
 |
 |
Date :
2009-12-07 00:56:34 |
By :
somparn |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ผมคิดว่าน่าจะเป็นที่ตรงนี้นะ
elseif($_GET['action'] == "register")
<form name="form1" id="form1" method="post" action="?name=user&file=register" onsubmit="return checkForm()">
ตอนส่งเป็นตัวแปร file แต่เวลาเช็คดันเป็น action
ตอนสร้าง form ประกาศส่งเป็น method POST แต่เวลาส่งส่ง parameter GET มาด้วย มันจะทำงานได้ หรือไม่ อันนี้ไม่เคยลอง
|
 |
 |
 |
 |
Date :
2009-12-07 01:01:40 |
By :
DownsTream |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ตอนนี้มันเด้งหน้าจอสีขาวอย่างเดียวเลยครับ
|
 |
 |
 |
 |
Date :
2009-12-07 01:04:44 |
By :
อยากเก่ง |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ลองเปลี่ยนแล้วครับ
|
 |
 |
 |
 |
Date :
2009-12-07 01:05:52 |
By :
อยากเก่ง |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ได้แล้วครับขอบคุณครับ
|
 |
 |
 |
 |
Date :
2009-12-07 11:54:44 |
By :
อยากเก่ง |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
 
|
 |
 |
 |
 |
Date :
2009-12-07 12:08:17 |
By :
panyapol |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ช่วยหน่อยค่ะ คือมีปัญหาหน้า detail คะ คือต้องการให้ผู้ใช้ที่ต้องการดูข้อมูลทั้งหมดที่กรอกลงไปเมื่อกี้คะ
แต่ตอนนี้มันโชว์แต่ข้อมูลชุดแรกที่อยู่ในฐานฯตลอดเลยคะ
<?
$link = mysql_connect("localhost", "root", "root"); // กำหนดชื่อโฮสต์, user name และ รหัสผ่าน
mysql_query("Use test;"); // เรียกใช้ฐานข้อมูล
$sql = "Select * From com ;"; // ดึงเรคคอร์ดทั้งหมดจากตาราง
$i=0;
$result = mysql_query($sql);
while ($dbarr = mysql_fetch_array($result))
{
$i++;
echo "<table border=1>";
echo "<tr>";
echo "<td>ยี่ห้อ :</td>";
echo "<td>$dbarr[Brand_com]</td>";
echo "</tr>";
echo "<tr>";
echo "<td> รุ่น : </td>";
echo "<td>$dbarr[Model_com]</td>";
echo "</tr>";
echo "<tr>";
echo "<td>MAC Address :</td>";
echo "<td>$dbarr[MAC_address]</td>";
echo "</tr>";
echo "<tr>";
echo "<td> Serial Number : </td>";
echo "<td>$dbarr[Serial_number]</td>";
echo "</tr>";
echo "<tr>";
echo "<td> เลขครุภัณฑ์ :</td>";
echo "<td>$dbarr[Asset_number]</td>";
echo "</tr>";
echo "<tr>";
echo "<td>ชื่อเครื่อง :</td>";
echo "<td>$dbarr[Com_name]</td>";
echo "</tr>";
echo "<tr>";
echo "<td> Workgroup : </td>";
echo "<td>$dbarr[Workgroup]</td>";
echo "</tr>";
echo "<tr>";
echo "<td> Operating System : </td>";
echo "<td>$dbarr[Operating_system]</td>";
echo "</tr>";
echo "<tr>";
echo "<td>Office : </td>";
echo "<td>$dbarr[Office]</td>";
echo "</tr>";
echo "<tr>";
echo "<td>CPU : </td>";
echo "<td>$dbarr[CPU]</td>";
echo "</tr>";
echo "<tr>";
echo "<td>RAM :</td>";
echo "<td>$dbarr[RAM]</td>";
echo "</tr>";
echo "<tr>";
echo "<td>IP Address :</td>";
echo "<td>$dbarr[IP_address]</td>";
echo "</tr>";
echo "<tr>";
echo "<td>Subnet Mask : </td>";
echo "<td>$dbarr[Subnet_mask]</td>";
echo "</tr>";
echo "<tr>";
echo "<td>Default Gateway : </td>";
echo "<td>$dbarr[Default_gateway]</td>";
echo "</tr>";
echo "<tr>";
echo "<td>หน้าที่เครื่อง : </td>";
echo "<td>$dbarr[Function_machine]</td>";
echo "</tr>";
echo "<tr>";
echo "<td> หมายเลขสาย LAN ชื่อ : </td>";
echo "<td>$dbarr[LAN_num]</td>";
echo "</tr>";
echo "<tr>";
echo "<td>โปรแกรม Anti Virus : </td>";
echo "<td>$dbarr[Program_anti_virus]</td>";
echo "</tr>";
echo "<tr>";
echo "<td>อุปกรณ์ต่อร่วม : </td>";
echo "<td>$dbarr[Connected_together]</td>";
echo "</tr>";
echo "<tr> ";
echo "<td>Switching Hub ยี่ห้อ : </td>";
echo "<td>$dbarr[Brand_sw_hub]</td>";
echo "</tr>";
echo "<tr>";
echo "<td>ขนาด Switching Hub : </td>";
echo "<td>$dbarr[Size_sw_hub]</td>";
echo "</tr>";
echo "<tr>";
echo "<td>ชนิดจอแสดงผล : </td>";
echo "<td>$dbarr[Moniter_type]</td>";
echo "</tr>";
echo "<tr>";
echo "<td>ขนาดจอแสดงผล : </td>";
echo "<td>$dbarr[Moniter_size]</td>";
echo "</tr>";
echo "<tr>";
echo "<td>อาคาร : </td>";
echo "<td>$dbarr[Building_locat]</td>";
echo "</tr>";
echo "<tr>";
echo "<td>ชั้น : </td>";
echo "<td>$dbarr[Floor_locat]</td>";
echo "</tr>";
echo "<tr>";
echo "<td> หน่วยงาน :</td>";
echo "<td>$dbarr[Agencies_locat]</td>";
echo "</tr>";
echo "<tr>";
echo "<td>เลขที่ห้อง :</td>";
echo "<td>$dbarr[No_room_locat]</td>";
echo "</tr>";
echo "<tr>";
echo "<td>ชื่อ(ไทย) : </td>";
echo "<td>$dbarr[Name_thai_respons]</td>";
echo "</tr>";
echo "<tr> ";
echo "<td>ชื่อ( Eng) : </td>";
echo "<td>$dbarr[Name_eng_respons]</td>";
echo "</tr>";
echo "<tr>";
echo "<td>ตำแหน่ง : </td>";
echo "<td>$dbarr[Position_respons]</td>";
echo "</tr>";
echo "<tr>";
echo "<td>โทรศัพท์ : </td>";
echo "<td>$dbarr[Telephone]</td>";
echo "</tr>";
echo "<tr>";
echo "<td>จำนวนผู้ใช้ :</td>";
echo "<td>$dbarr[Num_users]</td>";
echo "</tr>";
echo "<tr> ";
echo "<td>ชื่อผู้บันทึก :</td>";
echo "<td>$dbarr[Name_record]</td>";
echo "</tr>";
echo "</table>";
break;
}
mysql_close($link);
?>
ทำไงดีค่ะ
|
 |
 |
 |
 |
Date :
2010-07-01 14:06:24 |
By :
ทิว |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ผมไม่แน่ใจเหมือนกันนะ
แต่ ลองเอา break เอาสิ
|
 |
 |
 |
 |
Date :
2010-07-01 14:09:46 |
By :
50121680 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
พี่หมายถึงให้ลองเอา break ออก ใช่หรือป่าวค่ะ
ถ้าเอาออกมันจะขึ้นมาหลายตาราง คือ 1ตารางต่อ1ชุดข้อมูล ในฐานมีข้อมูลเท่าไหร่จะขึ้นมาทั้งหมดคะ
ทำไงคะ
|
 |
 |
 |
 |
Date :
2010-07-01 14:36:40 |
By :
ทิว |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ปัญหาคือว่า วนลูปไม่เป็นอ่ะคะ คือ สมมต ข้อมูลในฐานมี 3 ชุด
ชุด 1 ttttttttttttttttttttttt
ชุด 2 ddddddddddddd
ชุด 3 eeeeeeeeeeeee
คือมันจะโชว์เฉพาะ tttttttttttttttttttttttt คะ
|
 |
 |
 |
 |
Date :
2010-07-06 10:07:35 |
By :
ทิว |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
วนลูปตารางครับ ลองดู ครับ
<form method="post" name="form_test">
<?
if(!isset($start)){
$start = 0;
}
$limit = '10'; // แสดงผลหน้าละกี่หัวข้อ
/* หาจำนวน record ทั้งหมด
ปล. อันนี้ต้องใช้กับตัวแบ่งนะ ห้ามเอาออก*/
$Qtotal = mysql_query("select * from product "); //คิวรี่ คำสั่ง
$total = mysql_num_rows($Qtotal); // หาจำนวน record
/* คิวรี่ข้อมูลออกมาเพื่อแสดงผล */
$Query = mysql_query("select * from product ORDER BY ID_Pro DESC LIMIT $start,$limit"); //คิวรี่คำสั่ง
$totalp = mysql_num_rows($Query); // หาจำนวน record ที่เรียกออกมา
$intRows = 0;
?>
<table width="800" align="center">
<tr>
<?
while($arr = mysql_fetch_array($Query)){
$intRows++;
echo "<td>";
?>
<table width="91" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><div align="center"><a href="../admin/Product/images_product/<?=$arr["Image_Pro"];?>" target="_blank"><img src="../admin/Product/images_product/<?=$arr["Image_Pro"];?>" width="100" height="100" border="0"></a></div></td>
</tr>
<tr>
<td><div align="left"><span class="narmal3old"><?=$arr["Name_Pro"];?></span></div></td>
</tr>
<tr>
<td><div align="left"><span class="narmal3old">Price: <?=$arr["Price_Pro"];?> BATH/<?=$arr["Unit"];?></span></div></td>
</tr>
<tr>
<td><div align="left"><span class="narmal3old">Color: <?=$arr["Color_Pro"];?></span></div></td>
</tr>
<tr>
<td ><div align="left"><span class="narmal3old">Size: <?=$arr["Size_Pro"];?></span></div></td>
</tr>
</table>
<?
echo"</td>";
if(($intRows)%5==0)
{
echo"</tr>";
}
else
{
echo "<td>";
}
}
//echo"</tr></table>";
?>
</tr>
</table>
<?
$page = ceil($total/$limit); // เอา record ทั้งหมด หารด้วย จำนวนที่จะแสดงของแต่ละหน้า
/* เอาผลหาร มาวน เป็นตัวเลข เรียงกัน เช่น สมมุติว่าหารได้ 3 เอามาวลก็จะได้ 1 2 3 */
for($i=1;$i<=$page;$i++){
if($_REQUEST['page']==$i){ //ถ้าตัวแปล page ตรง กับ เลขที่วนได้
echo "[<a href='?start=".$limit*($i-1)."&page=$i'><B>$i</B></A>]"; //ลิ้งค์ แบ่งหน้า เงื่อนไขที่ 1
}else{
echo "[<a href='?start=".$limit*($i-1)."&page=$i'>$i</A>]"; //ลิ้งค์ แบ่งหน้า เงื่อนไขที่ 2
}
}
?>
</form>
|
 |
 |
 |
 |
Date :
2010-07-06 12:35:31 |
By :
yesser |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ช่วยดูโค้ดให้หน่อยได้ไหมค่ะว่าทำไมข้อมูลมันไม่ขึ้นมาโชว์อ่ะค่ะ คือหน้านี้ต้องการดึงข้อมูลขึ้นโชว์เพื่อแก้ไขอ่ะคะ
<?
echo $MAC_address=$_POST['MAC_address'];
echo $Asset_number=$_POST['Asset_number'];
echo $Serial_number=$_POST['Serial_number'];
echo $Brand_com=$_POST['Brand_com'];
echo $Model_com=$_POST['Model_com'];
echo $Com_name=$_POST['Com_name'];
echo $Workgroup=$_POST['Workgroup'];
echo $Operating_system=$_POST['Operating_system'];
echo $Office=$_POST['Office'];
echo $CPU=$_POST['CPU'];
echo $RAM=$_POST['RAM'];
echo $IP_address=$_POST['IP_address'];
echo $Subnet_mask=$_POST['Subnet_mask'];
echo $Default_gateway=$_POST['Default_gateway'];
echo $LAN_num =$_POST['LAN_num'];
echo $Program_anti_virus=$_POST['Program_anti_virus'];
echo $Connected_together =$_POST['Connected_together'];
echo $Moniter_size=$_POST['Moniter_size'];
echo $Brand_sw_hub=$_POST['Brand_sw_hub'];
echo $Size_sw_hub=$_POST['Size_sw_hub'];
echo $Building_locat=$_POST['Building_locat'];
echo $Floor_locat=$_POST['Floor_locat'];
echo $Agencies_locat=$_POST['Agencies_locat'];
echo $No_room_locat=$_POST['No_room_locat'];
echo $Name_thai_respons=$_POST['Name_thai_respons'];
echo $Name_eng_respons=$_POST['Name_eng_respons'];
echo $Position_respons=$_POST['Position_respons'];
echo $Telephone=$_POST['Telephone'];
echo $Num_users=$_POST['Num_users'];
echo $Name_record=$_POST['Name_record'];
echo $Date=$_POST['Date'];
echo $Month=$_POST['Month'];
echo $Year=$_POST['Year'];
echo $Function_machine1=$_POST['Function_machine1'];
echo $Function_machine2=$_POST['Function_machine2'];
echo $Function_machine3=$_POST['Function_machine3'];
echo $Function_machine4=$_POST['Function_machine4'];
echo $Function_machine5=$_POST['Function_machine5'];
echo $Moniter_type1=$_POST['Moniter_type1'];
echo $Moniter_type2=$_POST['Moniter_type2'];
?>
<?
$hostname = "localhost";//=ชื่อโฮสต์
$usre = "root";//ชื่อผู้ใช้
$password ="root";//รหัสผ่าน
$dbname ="test";//ชื่อฐานข้อมูล
$tblname ="com";//ชื่อตาราง
//เริ่มติดต่อฐานข้อมูล
mysql_connect($hostname,$usre,$password)or die ("ติดต่อฐานข้อมูลไม่ได้");
//เลือกฐานข้อมูล
mysql_select_db($dbname) or die ("เลือกฐานข้อมูลไม่ได้");
$sql="INSERT INTO $tblname VALUES ('$MAC_address','$Asset_number','$Serial_number','$Brand_com','$Model_com','$Com_name','$Workgroup','$Operating_system','$Office','$CPU','$RAM','$IP_address','$Subnet_mask','$Default_gateway','$LAN_num','$Program_anti_virus','$Connected_together','$Moniter_size','$Brand_sw_hub','$Size_sw_hub','$Building_locat','$Floor_locat','$Agencies_locat','$No_room_locat','$Name_thai_respons','$Name_eng_respons','$Position_respons','$Telephone','$Num_users','$Name_record','$Date','$Month','$Year','$Function_machine1','$Function_machine2','$Function_machine3','$Function_machine4','$Function_machine5',
'$Moniter_type1','$Moniter_type2')";//กำหนดคำสั่งsqlเพื่อเพิ่มข้อมูลแบบคีย์ในคำสั่งsql
$dbquery=mysql_db_query($dbname,$sql);//ปิดการติดต่อฐานข้อมูล
mysql_close();
?>
<!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=tis-620" />
<title>แบบฟอร์มแก้ไขรายการคอมพิวเตอร์</title>
<style type="text/css">
<!--
body {
background-color: #EDF8F8;
}
.style2 {font-size: 14px; }
-->
</style>
</head>
<body>
<form id="form1" name="form1" method="post" action="editcom.php">
<p align="center"> </p>
<p align="center" class="style23"><img src="images.jpg" width="130" height="130" /></p>
<p align="center" class="style23">ศูนย์สารสนเทศ กรมชลประทาน</p>
<p align="center">(ตรวจสอบข้อมูล)</p>
<p> </p>
<table width="880" border="0" align="center" cellpadding="0" cellspacing="0">
<tr class="style2">
<td width="151"><div align="right" class="style2"><span class="style25">ยี่ห้อ:</span></div></td>
<td width="276"><input name="Brand_com" type="text" value="<? echo $Brand_com;?>" size="32" /></td>
<td width="194"><div align="right" class="style2"><span class="style25">รุ่น:</span></div></td>
<td width="192"><input name="Model_com" type="text" value="<? echo $Model_com;?>" size="32" /></td>
</tr>
<tr class="style2">
<td><div align="right" class="style2"><span class="style25">Serial Number:</span></div></td>
<td><input name="Serial_number" type="text" value="<? echo $Serial_number;?>" size="32" /></td>
<td><div align="right" class="style2"><span class="style25">เลขที่ครุภัณฑ:์</span></div></td>
<td><input name="Asset_number" type="text" value="<? echo $Asset_number;?>" size="32" /></td>
</tr>
<tr class="style2">
<td><div align="right" class="style2"><span class="style25">ชื่อเครื่อง:</span></div></td>
<td><input name="Com_name" type="text" value="<? echo $Com_name;?>" size="32" /></td>
<td><div align="right" class="style2"><span class="style25">Workgroup:</span></div></td>
<td><input name="Workgroup" type="text" value="<? echo $Workgroup;?>" size="32" /></td>
</tr>
<tr class="style2">
<td><div align="right" class="style2"><span class="style25">Operating System:</span></div></td>
<td><input name="Operating_system" type="text" value="<? echo $Operating_system;?>" size="32" /></td>
<td><div align="right" class="style2"><span class="style25">Office:</span></div></td>
<td><input name="Office" type="text" value="<? echo $Office;?>" size="32" /></td>
</tr>
<tr class="style2">
<td><div align="right" class="style2"><span class="style25">CPU:</span></div></td>
<td><input name="CPU" type="text" value="<? echo $CPU;?>" size="32" /></td>
<td><div align="right" class="style2"><span class="style25">RAM:</span></div></td>
<td><input name="RAM" type="text" value="<? echo $RAM;?>" size="32" /></td>
</tr>
<tr class="style2">
<td><div align="right" class="style2"><span class="style25">MAC Address: </span></div></td>
<td><span class="style2 style15">
<input type="text" name="MAC_address" value="<? echo $MAC_address;?>" size="32" />
</span></td>
<td><div align="right" class="style2"><span class="style25">IP Address: </span></div></td>
<td><input name="IP_address" type="text" value="<? echo $IP_address;?>" size="32" /></td>
</tr>
</table>
<br />
<table width="888" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="165" class="style2"><div align="right"><span class="style25">Subnet Mask: </span></div></td>
<td width="377" class="style2"><input name="Subnet_mask" type="text" value="<? echo $Subnet_mask;?>" size="32" /></td>
<td width="116" class="style2"><div align="right"><span class="style25">Default Gateway:</span></div></td>
<td width="230" class="style2"><input name="Default_gateway" type="text" value="<? echo $Default_gateway;?>" size="32" /></td>
</tr>
<tr>
<td class="style2"><div align="right"><span class="style25">หน้าที่เครื่อง:</span></div></td>
<td class="style2"><span class="style25">
<input type="checkbox" name="Function_machine1" value="<?php echo $Function_machine1; ?>" <? if($Function_machine1=='Offices')echo "checked='checked'";?> />Offices
<input type="checkbox" name="Function_machine2" value="<?php echo $Function_machine2; ?>" <? if($Function_machine2=='Internet')echo "checked='checked'";?> />Internet
<input type="checkbox" name="Function_machine3" value="<?php echo $Function_machine3; ?>" <? if($Function_machine3=='สารบรรณฯ')echo "checked='checked'";?> />สารบรรณฯ
<input type="checkbox" name="Function_machine4" value="<?php echo $Function_machine4; ?>" <? if($Function_machine4=='Server')echo "checked='checked'";?> />Server
<input type="checkbox" name="Function_machine5" value="<?php echo $Function_machine5; ?>" <? if($Function_machine5=='Other')echo "checked='checked'";?> />Other
</span></td>
<td class="style2"><div align="right"><span class="style25">หมายเลขLAN ชื่อ:</span></div></td>
<td class="style2"><input name="LAN_num" type="text" value="<? echo $LAN_num;?>" size="32" /></td>
</tr>
<tr>
<td height="35" class="style2"><div align="right"><span class="style11 style2 style26">โปรแกรม Anti Virus:</span></div></td>
<td class="style2"><input name="Program_anti_virus" type="text" value="<? echo $Program_anti_virus;?>" size="32" /></td>
<td class="style2"><div align="right"><span class="style25">Switching Hub ยี่ห้อ: </span></div></td>
<td class="style2"><span class="style11 style2 style26">
<input type="text" name="Brand_sw_hub" value="<? echo $Brand_sw_hub;?>" size="32" />
</span></td>
</tr>
<tr>
<td height="31" class="style2"><div align="right"><span class="style25">จอแสดงผล:</span></div></td>
<td class="style2"><span class="style25">
<input type="radio" name="Moniter_type1" value="<?php echo $Moniter_type1; ?>" checked="checked" <? if($Moniter_type1=='CRT') echo "checked='checked'";?>/>CRT
<input type="radio" name="Moniter_type2" value="<?php echo $Moniter_type2; ?>" <? if($Moniter_type2=='LCD') echo "checked='checked'";?>/>LCD
ขนาด
<input name="Moniter_size" type="text" id="Moniter_size" value="<? echo $Moniter_size;?>" size="25" />
นิ้ว</span></td>
<td class="style2"><div align="right"><span class="style25">ขนาด:</span></div></td>
<td class="style2"><span class="style25">
<input type="text" name="Size_sw_hub" value="<? echo $Size_sw_hub;?>" size="10" />
port </span></td>
</tr>
<tr>
<td height="109" class="style2"><div align="right" class="style2"><span class="style25">อุปกรณ์ต่อร่วม:</span></div></td>
<td class="style2"><span class="style25 style2">
<textarea name="Connected_together" cols="60" rows="5" style=""><? echo $Connected_together;?></textarea>
</span></td>
<td class="style2"> </td>
<td class="style2"> </td>
</tr>
<tr>
<td height="25" class="style2">ตำแหน่งที่ตั้งเครื่อง</td>
<td class="style2"><span class="style2"></span></td>
<td><span class="style2"></span></td>
<td><span class="style2"></span></td>
</tr>
</table>
<br />
<table width="896" border="0" align="center" cellpadding="0" cellspacing="0">
<tr class="style2">
<td width="162"><div align="right"><span class="style25">อาคาร:</span></div></td>
<td width="320"><input name="Building_locat" type="text" value="<? echo $Building_locat;?>" size="32" /> </td>
<td width="186"><div align="right"><span class="style25">ชั้น:</span></div></td>
<td width="228"><input name="Floor_locat" type="text" value="<? echo $Floor_locat;?>" size="32" /></td>
</tr>
<tr class="style2">
<td><div align="right"><span class="style25">หน่วยงาน:</span></div></td>
<td><input name="Agencies_locat" type="text" value="<? echo $Agencies_locat;?>" size="32" /> </td>
<td><div align="right"><span class="style25">เลขที่ห้อง:</span></div></td>
<td><input name="No_room_locat" type="text" value="<? echo $No_room_locat;?>" size="32" /></td>
</tr>
<tr class="style2">
<td height="59"><span class="style28">ผู้รับผิดชอบเครื่อง</span></td>
<td><span class="style26"></span></td>
<td><span class="style26"></span></td>
<td><span class="style26"></span></td>
</tr>
<tr class="style2">
<td><div align="right"><span class="style25">ชื่อ(ไทย):</span></div></td>
<td><input name="Name_thai_respons" type="text" value="<? echo $Name_thai_respons;?>" size="32" /> </td>
<td><div align="right"><span class="style25">ชื่อ(อังกฤษ):</span></div></td>
<td><input name="Name_eng_respons" type="text" value="<? echo $Name_eng_respons;?>" size="32" /></td>
</tr>
<tr class="style2">
<td><div align="right"><span class="style25">ตำแหน่ง:</span></div></td>
<td><input name="Position_respons" type="text" value="<? echo $Position_respons;?>" size="32" /> </td>
<td><div align="right"><span class="style25">โทรศัพท์:</span></div></td>
<td><input name="Telephone" type="text" value="<? echo $Telephone;?>" size="32" /></td>
</tr>
<tr class="style2">
<td><div align="right"><span class="style25">จำนวนผู้ใช้:</span></div></td>
<td><span class="style11 style6 style2"><span class="style25">
<input type="text" name="Num_users" value="<? echo $Num_users;?>" size="32" />
คน/เครื่อง </span></span></td>
<td><div align="right"><span class="style26"></span></div></td>
<td><span class="style26"></span></td>
</tr>
<tr class="style2">
<td height="45"><span class="style26"></span></td>
<td><span class="style26"></span></td>
<td><div align="right"><span class="style28">ผู้บันทึกข้อมูล</span></div></td>
<td><span class="style11 style6 style2"><span class="style2 style26"> </span></span></td>
</tr>
<tr class="style2">
<td><span class="style26"></span></td>
<td><span class="style26"></span></td>
<td class="style2"><div align="right" class="style26">ชื่อ:</div></td>
<td><span class="style11 style6 style2"><span class="style2 style26">
<input type="text" name="Name_record" value="<? echo $Name_record;?>" size="32" />
</span></span></td>
</tr>
<tr class="style2">
<td> </td>
<td> </td>
<td class="style2"><div align="right" class="style26">วันที่:</div></td>
<td><label>
<select name="Date" size="1" id="Date" >
<option value="01">01</option>
<option value="02">02</option>
<option value="03">03</option>
<option value="04">04</option>
<option value="05">05</option>
<option value="06">06</option>
<option value="07">07</option>
<option value="08">08</option>
<option value="09">09</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14">14</option>
<option value="15">15</option>
<option value="16">16</option>
<option value="17">17</option>
<option value="18">18</option>
<option value="19">19</option>
<option value="20">20</option>
<option value="21">21</option>
<option value="22">22</option>
<option value="23">23</option>
<option value="24">24</option>
<option value="25">25</option>
<option value="26">26</option>
<option value="27">27</option>
<option value="28">28</option>
<option value="29">29</option>
<option value="30">30</option>
<option value="31">31</option>
</select>
<select name="Month" size="1" id="Month" >
<option value="มกราคม">มกราคม</option>
<option value="กุมภาพันธ์">กุมภาพันธ์</option>
<option value="มีนาคม">มีนาคม</option>
<option value="เมษายน">เมษายน</option>
<option value="พฤษภาคม">พฤษภาคม</option>
<option value="มิถุนายน">มิถุนายน</option>
<option value="กรกฎาคม">กรกฎาคม</option>
<option value="สิงหาคม">สิงหาคม</option>
<option value="กันยายน">กันยายน</option>
<option value="ตุลาคม">ตุลาคม</option>
<option value="พฤษจิกายน">พฤษจิกายน</option>
<option value="ธันวาคม">ธันวาคม</option>
</select>
<select name="Year" size="1" id="Year" >
<option value="2553">2553</option>
<option value="2554">2554</option>
<option value="2555">2555</option>
<option value="2556">2556</option>
<option value="2557">2557</option>
<option value="2558">2558</option>
<option value="2559">2559</option>
<option value="2560">2560</option>
</select>
</label></td>
</tr>
<tr class="style2">
<td height="79"><span class="style26"></span></td>
<td colspan="2"><div align="center" class="style26">
<div align="center">
<label>
<input type="submit" name="Submit" value="ยืนยัน" style="background-color:#9999FF" />
</label>
<label></label>
<input type="reset" name="Submit2" value="ยกเลิก" style="background-color:#9999FF" />
</div>
</div></td>
<td> </td>
</tr>
<tr class="style2">
<td height="51" colspan="2"><p class="style25"> </p>
<p align="right" class="style25"> </p></td>
<td><span class="style26"></span></td>
<td><span class="style26"></span></td>
</tr>
</table>
<p> </p>
<p align="center"> </p>
</form>
</body>
</html>
|
 |
 |
 |
 |
Date :
2010-07-06 15:31:31 |
By :
ทิว |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|