作者wheree (.)
看板PHP
標題[請益] 無法寫進資料庫
時間Tue Mar 3 19:18:46 2009
以下是我的程式碼
首頁(index.php)的部份
<html>
<form method = 'post' action='m1.php'>
帳號: <input type='text' name='id' size='12' maxlength='12'><br>
密碼: <input type='password name='pwd' size='14' maxlength='8'>
<input type = submit value = '確認送出'>
</html>
m1.php的部份
<?
$id = $_post["id"];
$pwd = $_post["pwd"];
$sql = "insert into `member`(`serial`,`id`,`pwd`,`datex`)
values ('','$id','$pwd',now())";
$result = mysql_query($sql,$link);
if($result) {echo "建立成功";}
else {echo "建立失敗";}
mysql_close($link);
?>
資料庫 資料表 還有欄位部分都建好了
在首頁輸入帳號密碼 送出後有顯示 "建立成功"
資料表裡有出現我設定的4個欄位
但是資料表裡的 欄位 沒有東西 沒有顯示我輸入的值
拜託各位幫我檢查程式哪裡有錯 感激不盡!
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 118.170.1.33
※ 編輯: wheree 來自: 118.170.1.33 (03/03 19:24)
※ 編輯: wheree 來自: 118.170.1.33 (03/03 19:33)
1F:推 appleboy46 :$_post["id"] -> $_POST["id"] 03/03 19:39
2F:→ wheree :成功了 感謝您! 03/03 19:48
3F:推 buganini :洞很大 洞不用錢... 03/03 23:46
4F:推 ybite :關鍵字:SQL injection 03/04 05:05
5F:推 kusoayan :推樓上-.- 03/04 08:09
6F:推 appleboy46 :mysql_real_escape 03/04 10:20