d.shankar Posted December 15, 2009 Share Posted December 15, 2009 Hi all i am using curl to submit data to this site given below. The data i send is getting into the textboxes but the form is not getting submitted unless i click it. <?php $tt_var5='General Fund'; $tt_var6='We are happy to donate to such a good charity organization'; $tt_var9='Submit Transaction'; $Curl_Session = curl_init('https://hopepark.com/signup/giving.php'); curl_setopt($Curl_Session, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($Curl_Session, CURLOPT_SSL_VERIFYHOST, 2); curl_setopt($Curl_Session, CURLOPT_POST, 1); curl_setopt($Curl_Session, CURLOPT_POSTFIELDS, "total_amount=5&first_name=gdfgdg&last_name=435dgdg&address=dfgdfg45646&city=dfg&state=AZ&zip=789933&[email protected]&card_num=7899345345557&exp_date=03/2012&ccv=783&gift_designation=$tt_var5&comments=$tt_var6"); curl_setopt($Curl_Session, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($Curl_Session, CURLOPT_RETURNTRANSFER, 0); curl_exec($Curl_Session); curl_close($Curl_Session); ?> you can run it and check . please somebody tell me the reason behind this. Quote Link to comment https://forums.phpfreaks.com/topic/185264-a-small-tweak-to-this-curl-code/ Share on other sites More sharing options...
d.shankar Posted December 15, 2009 Author Share Posted December 15, 2009 I dont think this is too tough for php-freakers ... Quote Link to comment https://forums.phpfreaks.com/topic/185264-a-small-tweak-to-this-curl-code/#findComment-977989 Share on other sites More sharing options...
d.shankar Posted December 16, 2009 Author Share Posted December 16, 2009 any help ? Quote Link to comment https://forums.phpfreaks.com/topic/185264-a-small-tweak-to-this-curl-code/#findComment-978289 Share on other sites More sharing options...
nafetski Posted December 16, 2009 Share Posted December 16, 2009 Well when you complete the form, take a look at the data being sent via post (From Firebug) -----------------------------83550047620084160461300521576 Content-Disposition: form-data; name="cms_save" Submit Transaction -----------------------------83550047620084160461300521576 Content-Disposition: form-data; name="posted_page_name" page01 Try sending those variables as well - and I suspect your problem will be solved! Quote Link to comment https://forums.phpfreaks.com/topic/185264-a-small-tweak-to-this-curl-code/#findComment-978298 Share on other sites More sharing options...
d.shankar Posted December 16, 2009 Author Share Posted December 16, 2009 Hi dude.. it didnt work too <?php $tt_var5='General Fund'; $tt_var6='We are happy to donate to such a good charity organization'; $tt_var9='Submit Transaction'; $Curl_Session = curl_init('https://hopepark.com/signup/giving.php'); curl_setopt($Curl_Session, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($Curl_Session, CURLOPT_SSL_VERIFYHOST, 2); curl_setopt($Curl_Session, CURLOPT_POST, 1); curl_setopt($Curl_Session, CURLOPT_POSTFIELDS, "total_amount=5&first_name=gdfgdg&last_name=435dgdg&address=dfgdfg45646&city=dfg&state=AZ&zip=789933&[email protected]&card_num=7899345345557&exp_date=03/2012&ccv=783&gift_designation=$tt_var5&comments=$tt_var6&posted_page_name=page01&cms_save=Submit Transaction"); curl_setopt($Curl_Session, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($Curl_Session, CURLOPT_RETURNTRANSFER, 0); curl_exec($Curl_Session); curl_close($Curl_Session); ?> I appreciate your reply. I would be more glad if someone tried this code out from their end. Quote Link to comment https://forums.phpfreaks.com/topic/185264-a-small-tweak-to-this-curl-code/#findComment-978317 Share on other sites More sharing options...
d.shankar Posted December 16, 2009 Author Share Posted December 16, 2009 Hi can someone help ? Quote Link to comment https://forums.phpfreaks.com/topic/185264-a-small-tweak-to-this-curl-code/#findComment-978342 Share on other sites More sharing options...
oni-kun Posted December 16, 2009 Share Posted December 16, 2009 Why are you using CURL for a samedomain POST? It makes no sense. And yes, since PHP is serverside it needs to refresh before it displays something in a text box, if that is what you were asking. I'd recommend you use something other than CURL for this. Quote Link to comment https://forums.phpfreaks.com/topic/185264-a-small-tweak-to-this-curl-code/#findComment-978343 Share on other sites More sharing options...
d.shankar Posted December 16, 2009 Author Share Posted December 16, 2009 Dude i have used curl to post such things to many sites and 99% worked, except this. Quote Link to comment https://forums.phpfreaks.com/topic/185264-a-small-tweak-to-this-curl-code/#findComment-978344 Share on other sites More sharing options...
Deoctor Posted December 16, 2009 Share Posted December 16, 2009 hi dude i have done this before.u want to send suto submission of the fields right <?php $email='[email protected]'; $pass='test123'; $ref = "loginType=L&step=confirmation&originalURI=%2F&rt=&rp=&inputEmailHandle=$email&inputPassword=$pass"; $force = "https://accounts.craigslist.org/login?$ref"; echo "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"1; URL=$force\">"; ?> i have done that like this. if the same u want then revet back.. i think it is quite possible.. Quote Link to comment https://forums.phpfreaks.com/topic/185264-a-small-tweak-to-this-curl-code/#findComment-978347 Share on other sites More sharing options...
d.shankar Posted December 16, 2009 Author Share Posted December 16, 2009 Dude but i need to get the response after submission .. for eg: if the site receives cardnumber error after submission , i need to make note of it and get back.. so thats why i am using curl here. as u said is it possible to auto-submit with curl ? Quote Link to comment https://forums.phpfreaks.com/topic/185264-a-small-tweak-to-this-curl-code/#findComment-978348 Share on other sites More sharing options...
Deoctor Posted December 16, 2009 Share Posted December 16, 2009 it is not an issue with the curl, but the thing that i require is the parameters that would be required to the passed.. if u can get me that i ll give u the code with in minutes.. check the auto login code which i made sometime back. Quote Link to comment https://forums.phpfreaks.com/topic/185264-a-small-tweak-to-this-curl-code/#findComment-978349 Share on other sites More sharing options...
d.shankar Posted December 16, 2009 Author Share Posted December 16, 2009 Parameters ??? This is the thing i am passing.... total_amount=5&first_name=gdfgdg&last_name=435dgdg&address=dfgdfg45646&city=dfg&state=AZ&zip=789933&[email protected]&card_num=7899345345557&exp_date=03/2012&ccv=783&gift_designation=$tt_var5&comments=$tt_var6&posted_page_name=page01&cms_save=Submit Transaction Everything sits.. but it does not submit dude.... Quote Link to comment https://forums.phpfreaks.com/topic/185264-a-small-tweak-to-this-curl-code/#findComment-978351 Share on other sites More sharing options...
Deoctor Posted December 16, 2009 Share Posted December 16, 2009 u should pass the url like this https://hopepark.com/signup/giving.php?total_amount=5&first_name=gdfgdg&last_name=435dgdg&address=dfgdfg45646&city=dfg&state=AZ&zip=789933&[email protected]&card_num=7899345345557&exp_date=03/2012&ccv=783&gift_designation=General Fund&comments=We are happy to donate to such a good charity organization so change ur code like this $url_feed='https://hopepark.com/signup/giving.php?total_amount=5&first_name=gdfgdg&last_name=435dgdg&address=dfgdfg45646&city=dfg&state=AZ&zip=789933&[email protected]&card_num=7899345345557&exp_date=03/2012&ccv=783&gift_designation=GeneralFund&comments=We are happy to donate to such a good charityorganization'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url_feed); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_BINARYTRANSFER, true); $output = curl_exec($ch); Quote Link to comment https://forums.phpfreaks.com/topic/185264-a-small-tweak-to-this-curl-code/#findComment-978353 Share on other sites More sharing options...
d.shankar Posted December 16, 2009 Author Share Posted December 16, 2009 No dude its not wotking because it is using POST , not GET .. Did it work in your end ? Quote Link to comment https://forums.phpfreaks.com/topic/185264-a-small-tweak-to-this-curl-code/#findComment-978365 Share on other sites More sharing options...
Deoctor Posted December 16, 2009 Share Posted December 16, 2009 hi i think the post method he is using is encrypting the values through a javascript. so it could be possible unless u know what encryption type he is using. [pre]<form id="giving" action="https://hopepark.com/signup/giving.php" name="giving" method="POST" enctype="multipart/form-data"> [/pre] so the values that will be send will be encrypted and then be passed to the javascript( jquery.js) to validate these values.. Quote Link to comment https://forums.phpfreaks.com/topic/185264-a-small-tweak-to-this-curl-code/#findComment-978393 Share on other sites More sharing options...
d.shankar Posted December 16, 2009 Author Share Posted December 16, 2009 nice finding dude... so cant this be done ? Quote Link to comment https://forums.phpfreaks.com/topic/185264-a-small-tweak-to-this-curl-code/#findComment-978398 Share on other sites More sharing options...
Deoctor Posted December 16, 2009 Share Posted December 16, 2009 no i dont think so it could be.. :'( Quote Link to comment https://forums.phpfreaks.com/topic/185264-a-small-tweak-to-this-curl-code/#findComment-978405 Share on other sites More sharing options...
d.shankar Posted December 16, 2009 Author Share Posted December 16, 2009 aren't there any other way to crack this ?? Quote Link to comment https://forums.phpfreaks.com/topic/185264-a-small-tweak-to-this-curl-code/#findComment-978595 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.