The following PHP script allows you to test your contact form captcha integration in Magento. If you receive any email after executing this script, you have to review your captcha integration.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
<?php $url = '{base_url}/contacts/index/post/'; $fields = array( 'name' => urlencode('Bad spam test'), 'email' => urlencode('somebody@gmail.com'), 'state' => urlencode('Any State'), 'postcode' => urlencode(''), 'telephone' => urlencode(''), 'comment' => urlencode('Bad spam test'), 'recaptcha-verification-1' => urlencode('checked'), ); $query = http_build_query($fields); $ch = curl_init(); curl_setopt($ch,CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch,CURLOPT_URL, $url); curl_setopt($ch,CURLOPT_POST, count($fields)); curl_setopt($ch,CURLOPT_POSTFIELDS, $query); $result = curl_exec($ch); curl_close($ch); ?> |
You may need to add, remove or rename fields in the $field array. Don’t forget to replace {base_url} with your actual URL.