login to phpBB using curl

  curl, node.js, php, python, web-scraping

I want to login using curl to a phpBB forum.

I’m testing my script of loggin in on https://forums.linuxmint.com/ucp.php?mode=login

you can test it there too.

I don’t want to make this question complicated, so I’ll not write code here, so everybody python, javascript, php, java or any other folks can answer this question.

here is what I did:

  1. create a file on the desktop called cookie.txt
  2. open the terminal (I’m using linux with bash shell by the way)
  3. I wrote this command and I hit enter
curl -b ~/Desktop/cookie.txt -c ~/Desktop/cookie.txt -X POST -F "username=YOUR_USER_NAME" -F 'password=YOUR_PASSWORD' "https://forums.linuxmint.com/ucp.php?mode=login"
  1. Here is the screenshot from ~/Desktop/cookie.txt:
    enter image description here

  2. I requested a page that require users to be logged in, here is one

curl -b ~/Desktop/cookie.txt -c ~/Desktop/cookie.txt "https://forums.linuxmint.com/memberlist.php?mode=viewprofile&u=62313"
  1. I read the output, and it’s not working.
  • How did I know that it doesn’t work?

A) just look at the page <title>, in the response of curl in the terminal, the <title> is Linux Mint Forums – Login, which means that the login is not successful for some reason.

anyone knows can help? any answer is appreciated!

Source: Ask PHP

LEAVE A COMMENT