Home > front end >  With reCAPTCHA validation issues
With reCAPTCHA validation issues

Time:11-17

Send messages to the email I have a PHP code, including email field judgment with the fear that Validform form malicious I submit, join Google's man-machine validation

Found that regardless of authentication can submit message, this how to break
The front end
 & lt; Tabpanel div role="" id=" Section4 & gt;" 



<script SRC="https://www.google.com/recaptcha/api.js" async defer> </script>
























* & lt;/td>
Name: & lt;/td>
* & lt;/td>
Email: & lt;/td>
* & lt;/td>
Company: & lt;/td>











$(function () {
$(". Registerform "). Validform ({
Tiptype: 2,
Postonce: true,
});
})
</script>



Feedback. PHP
 & lt; ? PHP the require (" SMTP. PHP "); 



//to use 163 mailbox server
//$smtpserver="smtp.163.com";
$smtpserver="ssl://smtp.163.com";
//163 mailbox server port
$smtpserverport=465;
//such as 163 server email accounts
$smtpusermail="account @ 163. com";
//the recipient mailbox $smtpemailto="$_POST [k_email]";

$smtpemailto="$_POST [k_email]";

//your email accounts (remove @ 163. com)
$smtpuser="account";//SMTP server user account
//your email password
$smtppass="password"; The user password//SMTP server, open authorization code, please fill in the authorization code
//
email subject$mailsubject="Down the PDF";
//email name="name" name="email" name="message"
//$mailbody="name: $_POST [k_name] \ r \ n email: $_POST [k_email] \ r \ n company: $_POST [k_cp] \ r \ n download links: & lt; A href='HTTP://https://bbs.csdn.net/topics/$_POST/k_pdf & gt; $_POST [k_pdf] ";
$mailbody="Name: $_POST \ r \ [k_name] nEmail: $_POST [k_email] \ r \ ncompany: $_POST [k_cp] \ r \ n 'download=' filename '& gt; $_POST [ktitle] ";

//email format (HTML/TXT), TXT to text email
$mailtype="HTML";
//here is a true said use authentication, otherwise do not use the authentication.
$SMTP=new SMTP ($smtpserver, $smtpserverport, true, $smtpuser, $smtppass);
//whether the show to send debugging information
$SMTP - & gt; The debug=FALSE;
//email
If ($SMTP - & gt; The sendmail ($smtpemailto, $smtpusermail, $mailsubject, $mailbody, $mailtype))


//Google captcha

$post_data=https://bbs.csdn.net/topics/array (
'secret'=& gt; '6 lcxxuizaaaaafbcgcx_u8impio3wys0xjuzqaac'
'response'=& gt; $_POST [" g - with recaptcha - response "]
);

$recaptcha_json_result=send_post (' https://www.google.com/recaptcha/api/siteverify ', $post_data);
$recaptcha_result=json_decode ($recaptcha_json_result);


?>




SMTP. PHP

 & lt; ? PHP 
The class SMTP
{
/* Public Variables */
Var $smtp_port;
Var $time_out;
Var $host_name;
Var $log_file;
Var $relay_host;
Var $debug;
Var $auth;
Var $user.
Var $pass;
/* Private Variables */
Var $sock;
Constractor/* */
Function SMTP ($relay_host="", $smtp_port=465, $auth=false, $user and $pass)
{
$this - & gt; The debug=FALSE;
$this - & gt; Smtp_port=$smtp_port;
$this - & gt; Relay_host=$relay_host;
$this - & gt; Time_out=30;//is 2 in fsockopen ()
$this - & gt; Auth=$auth.//auth
$this - & gt; User=$user;
$this - & gt; Pass=$pass;
$this - & gt; Host_name="localhost";//is informs the HELO command in
$this - & gt; Log_file="";
$this - & gt; The sock=FALSE;
}
/* the Main Function */
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related