Re: [請益] 圖形驗證的功能
印了你的 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
10/02 09:51, 2F
討論串 (同標題文章)
完整討論串 (本文為第 2 之 2 篇):
1
2
PHP 近期熱門文章
PTT數位生活區 即時熱門文章