Submitting form automatically... PHP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

ahsan
Forum Newbie
Posts: 6
Joined: Fri Feb 24, 2006 7:22 pm

I've donr it!

Post by ahsan »

I have done it bro! using curl!
its a fantastic tool to be used to submit Forms automatically!
Thank you all!

BUT! The solution leads me to another problem!
When I sumbit my form, it works just the wanted it to!
But the page I am posting the form to may have some
kinda security checking modules that returns an error message
saying that I don have permission to do that!

I am not posting any user name or password!
The server provides SMS service:

I POST:

-> my userID which tracks my account number
-> the mobile number to send the sms to
-> the body of the SMS
-> the length of the SMS body

and thats it!

I am not even trying to do anything that I am not suppose to! I am authorised to
use their service. They supplied me an userID that represents my account
number. Upon successful delivery of the SMS they deduct one credit from
my remaining credits. If I submit the form by my self using a browser it
works without any problem. Note that the Form stays on my server and I am
actually posting data from my server to their server. If it works this way Why
cant't I do it using CURL or fsocketopen? How do they know that the Form is
submitted by CURL not a human? Infact what's the difference?

Just stucked! Help Please!!!
MinDFreeZ
Forum Commoner
Posts: 58
Joined: Tue Feb 14, 2006 12:28 pm
Location: Lake Mary, FL

Post by MinDFreeZ »

is it a site that the link is like.. public? if so you can just post to that server using thier own "action" .. in the form...... like.. is there a link that this is publicly accessed?
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

try adding something like

Code: Select all

curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)');
to the curl call
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

or use Snoopy.
Post Reply