What im trying to figure out is how can i get the script to wait for the input and then continue with the rest of the forms.my $page = $mech->content; if ($page =~ /Please enter/) { #print $mech->content; my $captchaimage = $mech->find_image( url_regex => qr/site.com\/captch +a/i ); $captchaimage = $captchaimage->url; print "Content-type: text/html\n\n"; print "Enter the letters to continue!\n" . "<form>\n". "<img src='" . $captchaimage . "'>\n". '</br>' . '<input type=text name=\'CAPTCHA\'>' . '</br>' . '<input type=submit value=\'Continue...\'>' . "\n</form>"; if (param()) { my $captcha = param('CAPTCHA'); chomp($captcha); $mech->submit_form( form_number => 1, fields => { 'CAPTCHA' => $captcha } ); $page = $mech->content; if ($page =~ /Thank you/) { print "Success!\n"; } else { print "Error!\n" } } } else { print "Error!\n"; }
In reply to CGI script and captcha input by lazybowel
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |