|
|
|
รวบกวนช่วยดู code ให้หน่อยครับทำไมกดอัพเดทแล้ว ไม่ยอมส่งค่า id อ่ะครับ |
|
|
|
|
|
|
|
รบกวนพี่ๆช่วยดูให้หน่อยน่ะครับ
อันนี้หน้า form ครับ
Code (PHP)
<?
include '../inc/function.php';
$dblink = connect_db();
$strsql = "SELECT * FROM tbl_user where mem_Id = '$mem_Id'";
$resultsql = mysqli_query($dblink, $strsql);
$rows = mysqli_fetch_array($resultsql);
?>
<form method="POST" name="form1" id="form1" action="memupdate.php">
<h1><center>
<p>แก้ไขข้อมูล</p>
</center></h1>
<table align="center">
<tr valign="baseline">
<td nowrap="nowrap" align="left">รหัสสมาชิก:</td>
<td> <?= $rows[mem_Id]; ?></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="left">ชื่อผู้ใช้:</td>
<td><input type="text" name="mem_Pass" value="<? echo $rows['mem_User']; ?>" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="left">พาสเวิร์ด:</td>
<td><input type="password" name="mem_Pass" value="" size="32" placeholder="Password" />
(ขั้นต่ำ 6 ตัว a-z,0-9)</td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="left">ยืนยันพาสเวิร์ด:</td>
<td><input type="password" name="conmem_Pass" value="" size="32" placeholder="Password" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="left">ชื่อ-สกุล:</td>
<td><input type="text" name="mem_Name" value="<? echo $rows['mem_Name']; ?>" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="left">เบอร์โทร:</td>
<td><input type="text" name="mem_Tel" value="<? echo $rows['mem_Tel']; ?>" /></td>
</tr>
<tr valign="baseline">
<td align="left" valign="top" nowrap="nowrap">ที่อยู่:</td>
<td valign="top">
<textarea name="mem_Add" rows="5" cols="30" placeholder="Address"><? echo $rows['mem_Add']; ?></textarea></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="left">ตำบล:</td>
<td><input type="text" name="mem_Tumbon" value="<? echo $rows['mem_Tumbon']; ?>" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="left">อำเภอ:</td>
<td><input type="text" name="mem_Aumper" value="<? echo $rows['mem_Aumper']; ?>" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="left">จังหวัด:</td>
<td><input type="text" name="mem_City" value="<? echo $rows['mem_City']; ?>" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="left">รหัสไปรษณี:</td>
<td><input type="text" name="mem_Zip" value="<? echo $rows['mem_Zip']; ?>" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="left">อีเมล์:</td>
<td><input type="text" name="mem_Email" value="<? echo $rows['mem_Email']; ?>" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="left"> </td>
<td> </td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="center"> </td>
<td><input type="submit" value="submit" /><input type="reset" value="reset" /></td>
</tr>
</table>
</form>
ส่วนอันนี้หน้า process ครับ
Code (PHP)
<html>
<head>
<meta charset="utf-8">
<title>regist</title>
</head>
<body>
<?php
include '../inc/function.php';
$dblink = connect_db();
$user = $_POST["mem_User"];
$pass = $_POST["mem_Pass"];
$conpass = $_POST["conmem_Pass"];
$name = $_POST["mem_Name"];
$tel = $_POST["mem_Tel"];
$add = $_POST["mem_Add"];
$tumbon = $_POST["mem_Tumbon"];
$aumper = $_POST["mem_Aumper"];
$city = $_POST["mem_City"];
$zip = $_POST["mem_Zip"];
$email = $_POST["mem_Email"];
$status= $_POST["mem_Status"];
if($_POST["mem_Pass"] != $_POST["conmem_Pass"])
{
echo "พาสเวิดส์ ไม่ตรงกัน.....<br>";
echo "<a href='javascript:history.back()'>ย้อนกลับ</a>";
exit();
}
$strSQL = "SELECT * FROM tbl_user WHERE mem_User = '".trim($_POST['mem_User'])."' ";
$resultsql = mysqli_query($dblink, $strSQL);
$rows = mysqli_fetch_array($resultsql);
if($rows)
{
echo "มีชื่อผู้ใช้นี้อยู่แล้ว";
echo "<a href='javascript:history.back()'>ย้อนกลับ</a>";
}else{
$strSQL = "UPDATE tbl_user SET mem_User='$user', mem_Pass='$pass', mem_Name ='$name', mem_Tel = '$tel',
mem_Add ='$add', mem_Tumbon = '$tumbon', mem_Aumper = '$aumper', mem_City = '$city', mem_Zip='$zip', mem_Email='$email'
WHERE mem_Id = '$mem_Id'";
$resultsql = mysqli_query($dblink, $strSQL);
echo "string";
echo "<a href='indexul.php'>กลับหน้าแรก</a>";
}
?>
</body>
</html>
Tag : PHP
|
|
|
|
|
|
Date :
2015-11-18 06:03:45 |
By :
erlnw001 |
View :
719 |
Reply :
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
พอดีทำให้มันส่งค่า id ได้แล้ว ครับ แต่ทำไม ค่า mem_User เป็นค่าว่างอ่ะครับ
|
|
|
|
|
Date :
2015-11-18 06:48:15 |
By :
erlnw001 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (PHP)
<tr valign="baseline">
<td nowrap="nowrap" align="left">ชื่อผู้ใช้:</td>
<td><input type="text" name="mem_Pass" value="<? echo $rows['mem_User']; ?>" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="left">พาสเวิร์ด:</td>
<td><input type="password" name="mem_Pass" value="" size="32" placeholder="Password" />
(ขั้นต่ำ 6 ตัว a-z,0-9)</td>
</tr>
มันต้องเป็นแบบนี้รึเปล่าครับ
Code (PHP)
<tr valign="baseline">
<td nowrap="nowrap" align="left">ชื่อผู้ใช้:</td>
<td><input type="text" name="mem_User" value="<? echo $rows['mem_User']; ?>" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="left">พาสเวิร์ด:</td>
<td><input type="password" name="mem_Pass" value="" size="32" placeholder="Password" />
(ขั้นต่ำ 6 ตัว a-z,0-9)</td>
</tr>
|
|
|
|
|
Date :
2015-11-18 07:56:25 |
By :
R3D2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 01
|