Log into another site using php

Links for php scripts

Moderators: macek, egami, gesf

New php-forum User
New php-forum User
Posts: 1
Joined: Sun Jun 17, 2012 4:20 pm

Log into another site using php

Postby Albert » Sun Jun 17, 2012 4:27 pm

Hi there!

Me and my friend have been trying for the last 9 hours to make a php script which will log into a site which is password protected. We need to login in order to retrieve some data once we are inside. We then plan to store that in a database and compare that information on a daily basis, but that is all irrelevant if we can't get inside.

So heres the thing, we want to login to this site: http://www.hackforums.net/member.php?action=login
My friend wants to compare some reputation on a daily basis.

But the thing is we are quite the noobs at doing this whole php thing. We have so far only been able to find out which "functions" to use. All over the net people are telling each other they have to use cURL.

We are now asking for help, thank you in advance.

Sorry for bad grammar english is my second language

And don't worry none of this will be used for evil gains Image


php-forum Super User
php-forum Super User
Posts: 1805
Joined: Thu Mar 10, 2011 5:07 pm

Re: Log into another site using php

Postby johnj » Mon Jun 18, 2012 7:55 am

Please read up about php curl and try a few examples.

User avatar
php-forum GURU
php-forum GURU
Posts: 2196
Joined: Wed Oct 06, 2010 11:19 am
Location: Happy Valley, UT

Re: Log into another site using php

Postby egami » Mon Jun 18, 2012 10:42 am

you're asking for code to help do a little hacking on some HTML from hackforums.net; and you say it doesn't sound suspicious.

cURL is what you'll need.
You'll also need a valid login and password, a valid URL to attach to..

you'll need to read a little up on get_file_contents(); as well as some string manipulation tools to get what you want.. thinks like strpos, substr, strstr, preg_match, etc.

Good Luck!
I don't think you'll get exact code, and if you do.. I'd be leary about it.

Return to “PHP Scripts”

Who is online

Users browsing this forum: No registered users and 5 guests