PyraX Posted August 19, 2007 Share Posted August 19, 2007 Hi, What i need to do is submit a file to a form on a remote website. And before that happens I need to get the captcha image from the form and have it work once submitted. Thanks in advance. PyraX Quote Link to comment https://forums.phpfreaks.com/topic/65741-remote-form-file-submitting/ Share on other sites More sharing options...
keeB Posted August 20, 2007 Share Posted August 20, 2007 to get the captcha image from the form and have it work What is this? Quote Link to comment https://forums.phpfreaks.com/topic/65741-remote-form-file-submitting/#findComment-328401 Share on other sites More sharing options...
PyraX Posted August 20, 2007 Author Share Posted August 20, 2007 Those funky images that make sure your not a robot Quote Link to comment https://forums.phpfreaks.com/topic/65741-remote-form-file-submitting/#findComment-328509 Share on other sites More sharing options...
MadTechie Posted August 20, 2007 Share Posted August 20, 2007 Probably some bugs in their but its a start... <?php session_start(); $md5 = md5(microtime() * mktime()); $string = substr($md5,0,5); ?> <form action="check.php" method="post"> <input name="code" type="text" /> <img src="captcha.php" /> </form> captcha.php (the imagefile) <?php $captcha = imagecreatefrompng("./captcha.png"); $black = imagecolorallocate($captcha, 0, 0, 0); $line = imagecolorallocate($captcha,233,239,239); imageline($captcha,0,0,39,29,$line); imageline($captcha,40,0,64,29,$line); imagestring($captcha, 5, 20, 10, $string, $black); $_SESSION['key'] = md5($string); header("Content-type: image/png"); imagepng($captcha); ?> check.php <?php session_start(); if(md5($_POST['code']) != $_SESSION['key']) { die("Error: You must enter the code correctly"); }else{ echo 'You entered the code correctly'; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/65741-remote-form-file-submitting/#findComment-328529 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.