Life and tech

21Dec/115

Using PHP and CURL to log in to a website

The other day I wanted to automate some downloading from a username and password secured website. I wrote a quick script and it is working like a dream, below is the CURL part of the code that does the logging in and download.

Tagged as: , Leave a comment
Comments (5) Trackbacks (0)
  1. How can I get cookie.txt?

  2. i need this for my android application to login in craigslist.org and post through my app,
    i tried same to authenticate into craigslist.org but it is not working :(
    can you please suggest me what to do..

    • You need to look at the websites source and see if you are passing al the required info and if the username and password fields have the same name as in the example.

  3. Hadn’t used curl before and was on my third day of trying web tweaks. Finally was about to give up and tried one last one, this one. It worked the first time. Perfect!


Leave a Reply

No trackbacks yet.