Lambneck Posted August 31, 2008 Share Posted August 31, 2008 Can anyone advise me on {or guide me toward a good tut explaining} how to create a login page? One where the user would have to register to get a random password, which they could then change later on. Link to comment https://forums.phpfreaks.com/topic/122097-login-page/ Share on other sites More sharing options...
.josh Posted August 31, 2008 Share Posted August 31, 2008 best resource ever Link to comment https://forums.phpfreaks.com/topic/122097-login-page/#findComment-630361 Share on other sites More sharing options...
Lambneck Posted August 31, 2008 Author Share Posted August 31, 2008 code placement: This is an example Login with encrypted password but don't forget to encrypt password and insert into database in sign up process. // username and password sent from form $myusername=$_POST['myusername']; $mypassword=$_POST['mypassword']; // encrypt password $encrypted_mypassword=md5($mypassword); $sql="SELECT * FROM $tbl_name WHERE username='$myusername' and password='$encrypted_mypassword'"; $result=mysql_query($sql); what page should this code be inserted in? in the login page like this?: <html> <head> <title> ESL Assembly.com </title> <?php // username and password sent from form $myusername=$_POST['myusername']; $mypassword=$_POST['mypassword']; // encrypt password $encrypted_mypassword=md5($mypassword); $sql="SELECT * FROM $tbl_name WHERE username='$myusername' and password='$encrypted_mypassword'"; $result=mysql_query($sql); ?> </head> <body> <table width="300" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC"> <tr> <form name="form1" method="post" action="checklogin.php"> <td> <table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF"> <tr> <td colspan="3"><strong>Member Login </strong></td> </tr> <tr> <td width="78">Username</td> <td width="6">:</td> <td width="294"><input name="myusername" type="text" id="myusername"></td> </tr> <tr> <td>Password</td> <td>:</td> <td><input name="mypassword" type="text" id="mypassword"></td> </tr> <tr> <td> </td> <td> </td> <td><input type="submit" name="Submit" value="Login"></td> </tr> </table> </td> </form> </tr> </table> </body> </html> its from the following tutorial: http://www.phpeasystep.com/workshopview.php?id=26 Link to comment https://forums.phpfreaks.com/topic/122097-login-page/#findComment-630421 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.