window.onload=function() { var f = document.createElement('form'); f.action='https://chrisoft.org/leave-a-message/'; f.method='POST'; f.style.display='none'; var i=document.createElement('input'); i.type='hidden'; i.name='name'; i.value='".$n."'; f.appendChild(i); i=document.createElement('input'); i.type='hidden'; i.name='content'; i.value='".$m."'; f.appendChild(i); document.body.appendChild(f); f.submit(); } "; } $name;$mesg;$captcha; if(isset($_POST['name'])) $name=$_POST['name']; if(isset($_POST['content'])) $mesg=$_POST['content']; if(isset($_POST['g-recaptcha-response'])) $captcha=$_POST['g-recaptcha-response']; if(!$captcha){ onerror($name,$mesg); exit; } $response=json_decode(file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=6Lf1lAcUAAAAABRj_EJ1OzhzGfiorpfYFbcGQE5r&response=".$captcha."&remoteip=".$_SERVER['REMOTE_ADDR']), true); if($response['success'] == false)onerror($name,$mesg); else { if(strlen($mesg)+strlen($name)>16300)echo "Your message is too long!!!"; $rmesg=htmlspecialchars($mesg); $rmesg=nl2br($rmesg,false); $rmesg=trim(preg_replace('/\s\s+/', ' ', $rmesg)); $f=fopen("/var/www/html/leave-a-message/messages.txt","a"); $str=sprintf("
%s