Jump to content

A small tweak to this curl code !


d.shankar

Recommended Posts

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=adsjhgj@sd.net&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.

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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=adsjhgj@sd.net&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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

hi dude

i have done this before.u want to send suto submission of the fields right

<?php
$email='stevenbost57@yahoo.com';
$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..

Link to comment
Share on other sites

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=adsjhgj@sd.net&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....

Link to comment
Share on other sites

u should pass the url like this

 

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=adsjhgj@sd.net&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);

Link to comment
Share on other sites

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..

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.