Posting in a form using CURL PHP -
Posting in a form using CURL PHP -
this form:
<textarea name="message" id="messagecontent" rows="18" wrap="virtual" tabindex="2"></textarea> <span id="formsubmit"> <a href="#" class="formsubmit" tabindex="3"> <img src="/clear.gif" class="master-sprite sprite-pm-send"> </a> </span> the formsubmit class ajax function tracked downwards on source code, used fiddler capture params needed post , found this:
callcount=1 c0-scriptname=postfunctions c0-methodname=insertpost c0-id=1894_1310435282892 c0-param0=number:1578007 c0-param1=string:hello%20world! xml=true hello world! wrote on textarea , posted, fiddler found cookie on header, not sure if need utilize it. can help ? i'm trying post 2 days now, making me crazy ! thanks
request page , split cookie in http headers response example:
//get cookies $ch = curl_init("url"); $opts = array( curlopt_returntransfer => true, curlopt_header => true ); curl_setopt_array($ch, $opts); $res = curl_exec($ch); preg_match_all("/set-cookie:\s*([^\n]+)/i",$res,$cookies); $cookies = implode(";", $cookies[1]); //send post cookies in headers $ch = curl_init("url"); $opts = array( curlopt_returntransfer => true, curlopt_header => true, cuoropt_cookie => $cookies, curlopt_post => true, curlopt_postfields => $params ); curl_setopt_array($ch, $opts); $res = curl_exec($ch); php forms jquery curl
Comments
Post a Comment