SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict
    Join Date
    Dec 2011
    Posts
    221
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    When to use cURL

    All in my mind is to shift in secure coding, so I'm studying OOP PDO in php. Then here is the stuff they called cURL, I've heard it many times but this is just the time I pay attention to it. After searching about it, there is a question bugging in my mind,

    WHEN TO USE cURL? I'm now working on an inventory system.
    This is my first project. All I want is a fast and secure application,
    can this be helpful in my project?
    thank you.

  2. #2
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    Use cURL when you want to grab something from another website.

    You can use cURL to help you negotiate your way into a site which may require a POST or a GET submission with say a user/password and even cookies.

    Go in, get the response (usually though not always, a html stream) cache the output on your server then analyse the output to extract what you want.

    You might also grab the output of an API, or just try and detect the return code, 200, 404 or whatever.

    This is the main reason I have used it. Does that help you?

  3. #3
    Keeper of the SFL StarLion's Avatar
    Join Date
    Feb 2006
    Location
    Atlanta, GA, USA
    Posts
    3,747
    Mentioned
    64 Post(s)
    Tagged
    0 Thread(s)
    Just a side note, as it's come up a few times recently:
    Make sure you have permission to pull data from the other website.

    Most websites explicitly forbid people to copy/'scrape' their data.
    Never grow up. The instant you do, you lose all ability to imagine great things, for fear of reality crashing in.

  4. #4
    SitePoint Addict
    Join Date
    Dec 2011
    Posts
    221
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    makes a little bit clearer now. So if my project doesn't have to do with other website, I don't need it anymore.
    Thank you for the responses!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •