[請益] 資料寫不進去......

看板PHP作者時間18年前 (2007/03/12 23:15), 編輯推噓1(100)
留言1則, 1人參與, 最新討論串1/3 (看更多)
已經爬文...阿 快瘋了 抓不到bug.... 請大家幫我看看 謝謝 資料寫進去(insert into )都是空的 真是見鬼了.......... ============================ <?php include 'function.php'; function goback ($msg) { echo "<center><h2>$msg<hr></h2><form>"; echo "<input type=button value=\"請返回上一頁\" onclick=\"history.back();\">"; echo "</form></center>"; } $id=$_post[id]; $psw=$_post[psw]; $repsw=$_post[repsw]; $idname=$_post[idname]; $tel=$_post[tel]; $addr=$_post[addr]; $ping=$_post[ping]; $email=$_post[email]; if( (empty($id)=="") || (empty($psw)=="") || (empty($repsw)=="") || (empty($idname)=="") || (empty($tel)=="") || (empty($addr)=="") || (empty($ping)=="") || (empty($email)=="") ) { goback("您有資料尚未輸入"); exit(); } else if ($psw != $repsw) { goback("密碼不一致"); exit(); } else { if(!($link=mysql_pconnect("localhost","root",""))) { exit(); } $rows=mysql_db_query("blackbaby","select * from memberuser where email='$email'"); $num=mysql_num_rows($rows); if($num<>0){ goback("這個email已經被登記過了"); exit(); } //create the user record $account_balance=0.00; $db=mysql_select_db("blackbaby"); $sql="Insert Into memberuser(id,psw,idname,tel,ping,addr,email,account_balance) Values ('$id','$psw','$idname','$tel','$ping','$addr','$email','$account_balance')"; mysql_query($sql); } ?> -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 125.232.3.249 ※ 編輯: tstanly 來自: 125.232.3.249 (03/12 23:41)

03/13 00:31, , 1F
POST大寫試試 另外empty這樣用好像怪怪的
03/13 00:31, 1F
文章代碼(AID): #15zMw5vw (PHP)
文章代碼(AID): #15zMw5vw (PHP)