Re: [請益] 圖形驗證的功能

看板PHP作者 (3WA問題解決專家)時間15年前 (2010/10/02 00:12), 編輯推噓1(101)
留言2則, 1人參與, 最新討論串2/2 (看更多)
印了你的 session 得到下面的內容 sigmyjz|1285948732 print_r($_POST); //檢查你的傳值 Array ( [customer_name] => test [customer_email] => abc [customer_phone] => dee [message] => asdfasdf [captcha_response] => sigmyjz ^^^^^^^^^^^^^^^^ 注意,我輸入的東西 ~ [x] => 38 [y] => 19 ) Verify failed. correct code is sigmyjz, you if($ara[0] == $_POST['code']) 簡單的說~ 你 contact-us.html 你給GD驗證碼輸入的那個框 <input type="text" id="captcha_response" name="captcha_response">                         ^^^^^^^^^^^^^^^^ 你傳的 POST 的 index , 取名叫 captcha_response 但你比對檢查,卻用「$_POST['code']」 如此一來,當然比對錯誤啊~ if($ara[0] == $_POST['code']) 改成 if($ara[0] == $_POST['captcha_response']) 應該就功德半滿了~ -- 3WA訓練家的工作室 宗旨:諸葛單中,謝謝 個人佈弱格 網址:http://3wa.tw -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 123.240.83.60

10/02 09:49, , 1F
謝謝,改到頭昏,才發覺更新了測試檔案,卻沒更新主機檔案這
10/02 09:49, 1F

10/02 09:51, , 2F
個地方的錯誤,也就是我一直再用正確的檔案在debug, 難怪...
10/02 09:51, 2F
文章代碼(AID): #1CfWXMhn (PHP)
文章代碼(AID): #1CfWXMhn (PHP)