6 Replies - 2721 Views - Last Post: 19 May 2011 - 03:16 PM Rate Topic: -----

#1 hockey97   User is offline

  • D.I.C Regular

Reputation: -77
  • View blog
  • Posts: 300
  • Joined: 25-September 08

Need to learn about curl and how to use it properly...

Posted 18 May 2011 - 11:45 PM

Hi, I am trying to learn how to use curl. Here is what I want to do. I want to be able to send
data to a website that isn't mine and autofill and submit a form without me having to physically go on the page and click the stuff or enter the stuff.


Here is what I am doing. I am selling items from my website. These Items I don't have on hand.

I charge the client threw merchant account paypal. I put all information in a database and then I have a script wait for data coming from paypal that notifies me that the payment went threw. Then when that occures. I will grab that data from my database and then go to my suppliers website on the page that has a form. Then the script autofills the form and then hits submit.

Then that is it. I just will have to get a result from the submission maybe they might have a message saying order been sent.
I might if it's a div and it has a id. I will just check if the id is named successs then send back a 1 meaning the order was placed.

This is what I want to do. I been looking on the net for tutorials but fail to find one that explains in great detail how to autofill a form.

Not just that I need something that explains everything about curl and how to use it and examples of different stuff like downloading information and displaying it or grabbing data and displaying it or sending data to a form and submitting it.


Any ideas of a good online resource?

Is This A Good Question/Topic? 0
  • +

Replies To: Need to learn about curl and how to use it properly...

#2 JackOfAllTrades   User is offline

  • Saucy!
  • member icon

Reputation: 6259
  • View blog
  • Posts: 24,028
  • Joined: 23-August 08

Re: Need to learn about curl and how to use it properly...

Posted 19 May 2011 - 03:25 AM

Did you type "php curl tutorial" into your favorite search engine?

Instead of curl you could look into Snoopy.
Was This Post Helpful? 0
  • +
  • -

#3 codeprada   User is offline

  • Changed Man With Different Priorities
  • member icon

Reputation: 963
  • View blog
  • Posts: 2,382
  • Joined: 15-February 11

Re: Need to learn about curl and how to use it properly...

Posted 19 May 2011 - 04:33 AM

This is a very good book to get you started with cURL. curl.phptrack.com/

P.S. You don't need to make a form and autofill it to submit it to a website. You will soon see that you can send POST data directly to scripts.
Was This Post Helpful? 0
  • +
  • -

#4 CTphpnwb   User is offline

  • D.I.C Lover
  • member icon

Reputation: 3837
  • View blog
  • Posts: 13,998
  • Joined: 08-August 08

Re: Need to learn about curl and how to use it properly...

Posted 19 May 2011 - 06:32 AM

Since you're trying to do this for an actual business I suggest that you hire some one. This isn't something you want to learn on the job since there are security issues to worry about.
Was This Post Helpful? 0
  • +
  • -

#5 hockey97   User is offline

  • D.I.C Regular

Reputation: -77
  • View blog
  • Posts: 300
  • Joined: 25-September 08

Re: Need to learn about curl and how to use it properly...

Posted 19 May 2011 - 01:16 PM

View Postcodeprada, on 19 May 2011 - 05:33 AM, said:

This is a very good book to get you started with cURL. curl.phptrack.com/

P.S. You don't need to make a form and autofill it to submit it to a website. You will soon see that you can send POST data directly to scripts.



To responses other then codeprada. I did search google. I got just plain code. They says to auto fill a form and submit it do this and that and that.None explain the whole concept.

Yes, I am using it for a business but I am just starting it up. I coded my own 2 websites and I am doing this to learn more about programming. I want to be able to know programming to an advance / expert degree to be able to fix any problems that occur on my website by myself. I am mostly doing it for educational purposes.

So now on codeprada response. So I assume the curl is actually about sending http headers to a server directly ???

This is what I actually needed to know. Since most tutorials don't explain what your actually doing but just gives you the steps. Which I learned from the tutorials but didn't know exactly what it's basically doing in concept.

I thought you send a request to the web server in the internet. For their webpage. Then that data gets loaded. Like the form and images etc. You get this data then you can do whatever with it. You can display it or if you don't you can inject values into the input boxes and then hit the submit button or send some sort of submit command.which will send the post data. This is what I thought... but clearly it's a wrong assumption. So, from your post it tells me that what the curl is doing is directly sending the http headers to the server. We then change the values or information inside these headers to be able to direct where to send the headers and what we want the server to basically do for us.
Was This Post Helpful? 0
  • +
  • -

#6 CTphpnwb   User is offline

  • D.I.C Lover
  • member icon

Reputation: 3837
  • View blog
  • Posts: 13,998
  • Joined: 08-August 08

Re: Need to learn about curl and how to use it properly...

Posted 19 May 2011 - 02:55 PM

http://php.net/manual/en/book.curl.php

You can't think of anything on the web as a "page" since they're usually built on the fly. In PHP there are no pages, only files. The browser sees a page as being complete when the server stops sending information, and that information can be virtually any length depending on the script and parameters it receives. Think of things in terms of sessions, because that is what you need to create and manage with cURL.
Was This Post Helpful? 0
  • +
  • -

#7 JackOfAllTrades   User is offline

  • Saucy!
  • member icon

Reputation: 6259
  • View blog
  • Posts: 24,028
  • Joined: 23-August 08

Re: Need to learn about curl and how to use it properly...

Posted 19 May 2011 - 03:16 PM

I'm telling you. Download Snoopy, which I pointed to above, and read this.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1