php - Http post over a captcha protected jsp page using curl -
hello im trying make http post on jsp page using curl. it's not working. php code i'm trying.
<?php if(isset($_post['submit'])){ $captcha = $_post['answer']; $ch = curl_init(); curl_setopt($ch, curlopt_url,"http://example.com/post_comments.jsp"); curl_setopt($ch, curlopt_referer, 'http://www.example.com'); curl_setopt($ch, curlopt_post, 1); curl_setopt($ch, curlopt_postfields, "post_id=123&body=blabla&title=blabla&name=blablabla8&captcha=$captcha"); curl_setopt($ch, curlopt_returntransfer, true); $result= curl_exec ($ch); curl_close ($ch); echo $result; }else { ?> <form action="<?php echo $_server['php_self']; ?>" method="post"> <img src="http://example.com/captcha.jsp" /> <input name="answer" /> <p><input type="submit" name="submit" value="submit"></p> </form> <?php } ?>
anybody please guide correct it. in advance
web pages made navigated humans, thats why might miss many things... cookies or session data. best bet make valid request page , copy requests made. can in firefox/firebug example, or wireshark.
in short: missing cookies, emulate them
Comments
Post a Comment