Page 1 of 1

User Login System

Posted: Fri Dec 30, 2005 2:56 pm
by dwessell
Hi all.

First I'd like to say thanks to all of the wonderful hints, and suggestions. This forum has been a huge help in attempting to learn PHP.

And in that spirit, here's another question :-)

Is there a standard, almost pre-built user-login system around? I'm toying with the idea of this.. And was thinking that's is so common, and probably mostly standard.. That there's probably something already written, to be reused by the masses...

Thanks
David

Posted: Fri Dec 30, 2005 3:04 pm
by Burrito
you might try hotscripts. But really, creating a log in system is not a very challenging thing to do and therefore I think most people simply write their own.

I'd suggest you start writing your own and if you run into some issues, hit us up here and we can help you out. 8)

Posted: Fri Dec 30, 2005 3:05 pm
by IAD
I don't think i understand you "question", you want to get script for user login or an explain?

Posted: Fri Dec 30, 2005 3:13 pm
by dwessell
IAD,

Hi.. For a user to be able to login to the system, with a unique username and password.. Identifying them to the site for various reasons.


IAD wrote:I don't think i understand you "question", you want to get script for user login or an explain?
Burrito...

Thanks, I'll check into that.. I'm oh so new with PHP, and thought perhaps at this stage of my learning curve, something pre-built would be best :)

Thanks
David

Posted: Fri Dec 30, 2005 5:15 pm
by Burrito
dwessell wrote:I'm oh so new with PHP, and thought perhaps at this stage of my learning curve, something pre-built would be best :)
on the contrary...the best way to learn is to do it yourself :D

here's a hint as to a way you can achieve what you're after and should get you going....

Code: Select all

mysql_connect("localhost","username","password")
   or die(mysql_error());
mysql_select_db("somedatabase")
   or die(mysql_error());

$result = mysql_query("select * from users where username = '".mysql_real_escape_string($_POST['username'])."' and password = '".mysql_real_escape_string(md5($_POST['password']))."'")
   or die(mysql_error());
if($result = mysql_fetch_assoc($result))
   // valid user...do stuff
else
   // log in failed do something else

Posted: Fri Dec 30, 2005 7:03 pm
by m3mn0n
Google this and good results you shall get: php "user management" tutorial