PyraX Posted August 20, 2007 Share Posted August 20, 2007 Hi, Im looking for a solution for that will allow me to submit a form on a remote website that will send a file. The only think i know of that can do this is curl. I also need to grab the randomised image from the first site and submit the verification text. Thanks in advance. PyraX Quote Link to comment Share on other sites More sharing options...
GingerRobot Posted August 20, 2007 Share Posted August 20, 2007 I also need to grab the randomised image from the first site and submit the verification text. So you're trying to bypass a captcha type authentication? Good luck. I think you'll need it. The whole point of these image verifications is to prevent any automated, computer use of the form. Quote Link to comment Share on other sites More sharing options...
vijayfreaks Posted August 20, 2007 Share Posted August 20, 2007 captcha code: <?php /*********** POST DATA USING CURL **************/ //parameters for posting data $data = array('var1' => 5,"var2"=>10); // CURL Session initialization $ch = curl_init(); //CURL Option settings curl_setopt($ch, CURLOPT_URL,'http://localhost:9000/test/curl/post_action.php'); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //execution and posting data $res=curl_exec($ch); /*********** CAPTCHA CODE **************/ $str = ""; $length = 0; for ($i = 0; $i < 4; $i++) { $str .= chr(rand(97, 122)); } $imgX = 60; $imgY = 20; $image = imagecreatetruecolor(60, 20); $backgr_col = imagecolorallocate($image, 238,239,239); $border_col = imagecolorallocate($image, 208,208,208); $text_col = imagecolorallocate($image, 46,60,31); imagefilledrectangle($image, 0, 0, 60, 20, $backgr_col); imagerectangle($image, 0, 0, 59, 19, $border_col); $font = "VeraSe.ttf"; // it's a Bitstream font check www.gnome.org for more $font_size = 10; $angle = 0; $box = imagettfbbox($font_size, $angle, $font, $_SESSION['rand_code']); $x = (int)($imgX - $box[4]) / 2; $y = (int)($imgY - $box[5]) / 2; //imagettftext($image, $font_size, $angle, $x, $y, $text_col, $font, $_SESSION['rand_code']); imagettftext($image, $font_size, $angle, $x, $y, $text_col, $font, $str); header("Content-type: image/png"); imagepng($image); imagedestroy ($image); ?> Regards, Vijay Quote Link to comment 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.