User Login System

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
dwessell
Forum Commoner
Posts: 62
Joined: Fri Dec 23, 2005 2:30 pm

User Login System

Post 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
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post 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)
IAD
Forum Commoner
Posts: 42
Joined: Wed Dec 28, 2005 12:36 pm
Location: Israel, Soon Canada :)

Post by IAD »

I don't think i understand you "question", you want to get script for user login or an explain?
dwessell
Forum Commoner
Posts: 62
Joined: Fri Dec 23, 2005 2:30 pm

Post 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
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post 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
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

Google this and good results you shall get: php "user management" tutorial
Post Reply