|
|
|
ต้องการโชว์ข้อมูลใน texfile ก่อนทำการแก้ใขแต่มันไม่ยอมขึ้นช่วยดูให้โค้ดให้ครับ |
|
|
|
|
|
|
|
มันขึ้นว่า Not found comID=
สิ่งที่ผมต้องการคือ เมื่อเลือกแก้ใขข้อมูลผู้ใช้จะมองเห็นข้อมูลใน textfileก่อนทำการ update ของผมมันไม่ยอมโชว์ให้ครับ
Code (PHP)
<?php require_once('./Connections/db_conn.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>Edit</title>
<style type="text/css">
<!--
body,td,th {
font-family: MS Sans Serif, AngsanaUPC, Arial;
font-size: 14px;
}
.style1 {color: #3399FF}
-->
</style>
<link rel="stylesheet" type="text/css" href="epoch_styles.css" />
<script type="text/javascript" src="epoch_classes.js"></script>
<script type="text/javascript">
/*You can also place this code in a separate file and link to it like epoch_classes.js*/
var bas_cal,dp_cal,ms_cal;
window.onload = function () {
dp_cal = new Epoch('epoch_popup','popup',document.getElementById('popup_container'));
dp_cal = new Epoch('epoch_popup','popup',document.getElementById('popup_container2'));
ms_cal = new Epoch('epoch_multi','flat',document.getElementById('multi_container'),true);
};
</script>
</head>
<body>
<table width="515" height="324" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="139"> </td>
<td width="376" valign="top"><form action="SaveEdit.php?comID=<?=$_GET["comID"];?>" method="GET" name="formedit"><table width="351" border="0" cellspacing="0" cellpadding="0">
<?
mysql_connect($hostname_db_conn,$username_db_conn,$password_db_conn);
mysql_select_db($database_db_conn) or die("Error Connect to Database");
mysql_query('SET CHARACTER SET utf8');
$strSQL = "SELECT * FROM profilecomputer where comID = '".$_GET["comID"]."'";
$objDB = mysql_select_db("profilecomputer");
$objQuery = mysql_query($strSQL);
$objResult = mysql_fetch_array($objQuery);
if(!$objResult)
{
echo "Not found comID=".$_GET["comID"];
}
else
{
?>
<tr>
<td width="68" height="31"><span class="style1">
<label for="checkbox_row_1">locBud</label>
<label for="checkbox_row_2"></label>
</span></td>
<td colspan="2"><label>
<input type="text" name="field1" id="field1" value="<?=$objResult["locBud"];?>" />
</label></td>
<td width="132"><select name="select" id="select" onChange="formedit.field1.value=this.value" >
<option selected="selected">-----</option>
<option value="BDON">BDON</option>
<option value="BDON SUB">BDON SUB</option>
</select></td>
</tr>
<tr>
<td height="34"><span class="style1">
<label for="checkbox_row_2">locFlr</label>
</span></td>
<td colspan="2"><label>
<input type="text" name="field2" id="field2" />
</label></td>
<td><select name="select2" id="select2" onChange="formedit.field2.value=this.value" >
<option selected="selected">-----</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select></td>
</tr>
<tr>
<td height="30"><span class="style1">
<label for="checkbox_row_3">oROELocation</label>
</span></td>
<td colspan="2"><label>
<input type="text" name="field3" id="field3" />
</label></td>
<td><select name="select3" id="select3" onChange="formedit.field3.value=this.value" >
<option selected="selected">------</option>
<option value="EN_KKN">EN_KKN</option>
</select></td>
</tr>
<tr>
<td height="30"><span class="style1">
<label for="checkbox_row_4">Location1</label>
</span></td>
<td colspan="2"><label>
<input type="text" name="field4" id="field4" />
</label></td>
<td><select name="select4" id="select4" onChange="formedit.field4.value=this.value">
<option selected="selected">------</option>
<option value="EN_KKN">EN_KKN</option>
</select></td>
</tr>
<tr>
<td height="31"><span class="style1">
<label for="checkbox_row_5">TYPE</label>
</span></td>
<td colspan="2"><label>
<input type="text" name="field5" id="field5" />
</label></td>
<td><select name="select5" id="select5" onChange="formedit.field5.value=this.value">
<option selected="selected" >------</option>
<option value="NOTEBOOK">NOTEBOOK</option>
<option value="PC">PC</option>
<option value="PRINTER">PRINTER</option>
<option value="MORNITER">MORNITER</option>
</select></td>
</tr>
<tr>
<td height="26"><span class="style1">
<label for="checkbox_row_6">comid</label>
</span></td>
<td colspan="3"><label>
<input type="text" name="field6" id="field6" />
</label></td>
</tr>
<tr>
<td height="26"><span class="style1">
<label for="checkbox_row_7">comSN</label>
</span></td>
<td colspan="3"><label>
<input type="text" name="field7" id="field7" />
</label></td>
</tr>
<tr>
<td height="28"><span class="style1">
<label for="checkbox_row_8">Brand</label>
</span></td>
<td colspan="3"><label>
<input type="text" name="field8" id="field8" />
</label></td>
</tr>
<tr>
<td height="29"><span class="style1">
<label for="checkbox_row_9">Model</label>
</span></td>
<td colspan="3"><label>
<input type="text" name="field9" id="field9" />
</label></td>
</tr>
<tr>
<td height="28"><span class="style1">
<label for="checkbox_row_10">mtID</label>
</span></td>
<td colspan="3"><label>
<input type="text" name="field10" id="field10" />
</label></td>
</tr>
<tr>
<td height="27"><span class="style1">
<label for="checkbox_row_11">M_SerialNo</label>
</span></td>
<td colspan="3"><label>
<input type="text" name="field11" id="field11" />
</label></td>
</tr>
<tr>
<td height="26"><span class="style1">
<label for="checkbox_row_12">ownPin</label>
</span></td>
<td colspan="3"><label>
<input type="text" name="field12" id="field12" />
</label></td>
</tr>
<tr>
<td height="27"><span class="style1">
<label for="checkbox_row_13">ownTn</label>
</span></td>
<td colspan="3"><label>
<input type="text" name="field13" id="field13" />
</label></td>
</tr>
<tr>
<td height="27"><span class="style1">
<label for="checkbox_row_14">ownMail</label>
</span></td>
<td colspan="3"><label>
<input type="text" name="field14" id="field14" />
</label></td>
</tr>
<tr>
<td height="27"><span class="style1">
<label for="checkbox_row_15">ownComp</label>
</span></td>
<td colspan="2"><label>
<input type="text" name="field15" id="field15" />
</label></td>
<td><select name="select6" id="select6" onChange="formedit.field15.value=this.value">
<option selected="selected" >---</option>
<option value="AIS">AIS</option>
</select></td>
</tr>
<tr>
<td height="28"><span class="style1">
<label for="checkbox_row_16">ownEvp</label>
</span></td>
<td colspan="2"><label>
<input type="text" name="field16" id="field16" />
</label></td>
<td><select name="select7" id="select7" onChange="formedit.field16.value=this.value">
<option selected="selected" >---</option>
<option value="SO">SO</option>
</select></td>
</tr>
<tr>
<td height="33"><span class="style1">
<label for="checkbox_row_17">ownVp</label>
</span></td>
<td colspan="2"><label>
<input type="text" name="field17" id="field17" />
</label></td>
<td><select name="select8" id="select8" onChange="formedit.field17.value=this.value">
<option selected="selected" >---</option>
<option value="RO">RO</option>
</select></td>
</tr>
<tr>
<td height="27"><span class="style1">
<label for="checkbox_row_18">ownAvp</label>
</span></td>
<td colspan="2"><label>
<input type="text" name="field18" id="field18" />
</label></td>
<td><select name="select9" id="select9" onChange="formedit.field18.value=this.value">
<option selected="selected" >---</option>
<option value="RONE">RONE</option>
</select></td>
</tr>
<tr>
<td height="30"><span class="style1">
<label for="checkbox_row_19">ownDp</label>
</span></td>
<td colspan="2"><label>
<input type="text" name="field19" id="field19" />
</label></td>
<td><select name="select10" id="select10" onChange="formedit.field19.value=this.value">
<option selected="selected" >---</option>
<option value="DP-TO-UNE">DP-TO-UNE</option>
</select></td>
</tr>
<tr>
<td height="27"><span class="style1">
<label for="checkbox_row_20">ownSc</label>
</span></td>
<td colspan="2"><label>
<input type="text" name="field20" id="field20" />
</label></td>
<td><select name="select11" id="select11" onChange="formedit.field20.value=this.value">
<option selected="selected" >---</option>
<option value="SC-EN-KKN">SC-EN-KKN</option>
</select></td>
</tr>
<tr>
<td height="29"><span class="style1">
<label for="checkbox_row_21">Telephone</label>
</span></td>
<td colspan="3"><label>
<input type="text" name="field21" id="field21" />
</label></td>
</tr>
<tr>
<td height="28"><span class="style1">
<label for="checkbox_row_22">AssetCode</label>
</span></td>
<td colspan="3"><label>
<input type="text" name="field22" id="field22" />
</label></td>
</tr>
<tr>
<td height="28"><span class="style1">
<label for="checkbox_row_23">IPAddress</label>
</span></td>
<td colspan="3"><label>
<input type="text" name="field23" id="field23" />
</label></td>
</tr>
<tr>
<td height="27"><span class="style1">
<label for="checkbox_row_24">KeyboardID</label>
</span></td>
<td colspan="3"><label>
<input type="text" name="field24" id="field24" />
</label></td>
</tr>
<tr>
<td height="28"><span class="style1">
<label for="checkbox_row_25">K_SerialNo</label>
</span></td>
<td colspan="3"><label>
<input type="text" name="field25" id="field25" />
</label></td>
</tr>
<tr>
<td height="27"><span class="style1">
<label for="checkbox_row_26">startdate</label>
</span></td>
<td colspan="3"><label>
<input id="popup_container" type="text" />
</label></td>
</tr>
<tr>
<td height="28"><span class="style1">
<label for="checkbox_row_27">dendline</label>
</span></td>
<td colspan="3"><label>
<input id="popup_container2" type="text" />
</label></td>
</tr>
<tr>
<td height="27"><span class="style1">
<label for="checkbox_row_28">workage</label>
</span></td>
<td colspan="3"><label>
<input type="text" name="field26" id="field26" />
</label></td>
</tr>
<tr>
<td height="26"><span class="style1">
<label for="checkbox_row_29">CPU</label>
</span></td>
<td colspan="3"><label>
<input type="text" name="field27" id="field27" />
</label></td>
</tr>
<tr>
<td height="26"><span class="style1">
<label for="checkbox_row_30">HDD</label>
</span></td>
<td colspan="3"><label>
<input type="text" name="field28" id="field28" />
</label></td>
</tr>
<tr>
<td height="28"><span class="style1">
<label for="checkbox_row_31">RAM</label>
</span></td>
<td colspan="3"><label>
<input type="text" name="field29" id="field29" />
</label></td>
</tr>
<tr>
<td height="28"><span class="style1">
<label for="checkbox_row_32">LAN</label>
</span></td>
<td colspan="2"><label>
<input type="text" name="field30" id="field30" />
</label></td>
<td><select name="select12" id="select12" onChange="formedit.field30.value=this.value">
<option selected="selected" >---</option>
<option value="YES">YES</option>
<option value="NO">NO</option>
</select></td>
</tr>
<tr>
<td height="27"><span class="style1">
<label for="checkbox_row_33">WLAN</label>
</span></td>
<td colspan="2"><label>
<input type="text" name="field31" id="field31" />
</label></td>
<td><select name="select13" id="select13" onChange="formedit.field31.value=this.value">
<option selected="selected" >---</option>
<option value="YES">YES</option>
<option value="NO">NO</option>
</select></td>
</tr>
<tr>
<td height="27"><span class="style1">
<label for="checkbox_row_34">BT</label>
</span></td>
<td colspan="2"><label>
<input type="text" name="field32" id="tfield32" />
</label></td>
<td><select name="select14" id="select14" onChange="formedit.field32.value=this.value">
<option selected="selected" >---</option>
<option value="YES">YES</option>
<option value="NO">NO</option>
</select></td>
</tr>
<tr>
<td height="27"><span class="style1">
<label for="checkbox_row_35">Infared</label>
</span></td>
<td colspan="2"><label>
<input type="text" name="field33" id="field33" />
</label></td>
<td><select name="select15" id="select15" onChange="formedit.field33.value=this.value">
<option selected="selected" >---</option>
<option value="YES">YES</option>
<option value="NO">NO</option>
</select></td>
</tr>
<tr>
<td height="28"><span class="style1">
<label for="checkbox_row_36">genaral</label>
</span></td>
<td colspan="3"><label>
<input type="text" name="field34" id="field34" />
</label></td>
</tr>
<tr>
<td height="28"><span class="style1">
<label for="checkbox_row_37">remark</label>
</span></td>
<td colspan="3"><label>
<input type="text" name="field35" id="field35" />
</label></td>
</tr>
<tr>
<td> </td>
<td width="66"><div align="center">
<label>
<input type="submit" name="button" id="button" value="save" />
</label>
</div>
<label></label></td>
<td width="85"><input type="reset" name="button2" id="button2" value="cancel" /></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td colspan="3"> </td>
</tr>
<tr>
<td> </td>
<td colspan="3"> </td>
<?
}
mysql_close();
?>
</tr>
</table>
</form></td>
</tr>
</table>
</body>
</html>
Tag : PHP
|
|
|
|
|
|
Date :
2011-04-08 10:03:09 |
By :
thelak |
View :
820 |
Reply :
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ค่าที่ส่งมา query อ่ะค่ะ $_GET["comID"]
ค่านั้นถูกส่งมาหรือป่าวค่ะ ลอง echo ดูก่อนนะคะ
เพื่อค่ามันไม่มาอ่ะค่ะ ให้ดีน่าส่งเป็น POST นะคะ
|
|
|
|
|
Date :
2011-04-08 10:11:30 |
By :
penpimonmink |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo $strSQL ออกมาดูครับว่ามีไรเกิดขึ้น
|
|
|
|
|
Date :
2011-04-08 10:14:03 |
By :
Dragons_first |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ขอบคุณมากๆนะครับ
ได้แล้วครับผมงงเองครับ ผมมัวแต่ทดสอบ formedit
|
|
|
|
|
Date :
2011-04-08 10:31:21 |
By :
thelak |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 04
|