|
 |
|
สอบถามเกี่ยวกับการเรียกแสดงข้อมูล ว่าใครเป็นผู้โพสหรือบันทึุกข้อมูล |
|
 |
|
|
 |
 |
|
ถ้าจะให้แสดง ในการเก็บข้อมูลในฐานข้อมูล ก็จะต้อง เก็บ ชื่อผู้บันทึกลงไปด้วยครับ
|
 |
 |
 |
 |
Date :
2014-01-17 16:56:18 |
By :
FreshyMusiC |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
จะเพิ่มยังไงครับ
ให้มัน save ชื่อผู้บันทึกด้วย เวลา Login แล้ว
Code (PHP)
<?
$ch=$_GET["check"];
$l1 = $_POST["textfield1"];
$l2 = $_POST["textfield2"];
$l3 = $_POST["textfield3"];
$l4 = $_POST["txtss44"];
if($ch == "true" && $l1 != "" && $l2 != "" && $l3 != "" && $l4 != "" ){
mysql_connect("localhost","root","root");
mysql_select_db("test1");
mysql_query("SET NAMES UTF8");
$strSQL = "INSERT INTO product (List2,List3,List4,status) VALUES ('$l1','$l2','$l3','$l4')";
$objQuery = mysql_query($strSQL);
if($objQuery){
echo "<h3 align='center'>บันทึกเรียบร้อย</h3><br>";
echo "<meta http-equiv='refresh' content='1;URL=add1.php'>";
}else{
echo "Error";
}
}
?>
<form ACTION="add1.php?check=true" METHOD="post" NAME="form1">
<input name="txtss44" type="hidden" value="ยังไม่ขาย
" />
<table ALIGN="center" WIDTH="100%" BORDER="0" bordercolor="#FBBBBD" CELLSPACING="10" CELLPADDING="5">
<tr>
<td>
<th ALIGN="center" SCOPE="col">
<input type="image" src="images/444.png" name="submit" value="update" >
</th>
</tr>
<tr>
<td ALIGN="center" bgcolor="#FBBBBD"><font size="+1" > Item</td>
<td><label FOR="textfield1"></label>
<input name="textfield1" type="text" required id="textfield1" value="" size="64"></td>
</tr>
<tr>
<td ALIGN="center" bgcolor="#FBBBBD"><font size="+1" > Qty.</td>
<td><label FOR="textfield2"></label>
<input name="textfield2" type="text" required id="textfield2" value="" size="10" maxlength="10"></td>
</tr>
<tr>
<td ALIGN="center" bgcolor="#FBBBBD"><font size="+1" >อื่นๆ</td>
<td><label FOR="textfield3"></label>
<textarea name="textfield3" cols="64" required="required" id="textfield3"></textarea></td>
</tr>
</table>
</form>
|
ประวัติการแก้ไข 2014-01-17 18:18:14
 |
 |
 |
 |
Date :
2014-01-17 18:17:37 |
By :
cc00 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 03
|