Ondes Posted April 15, 2008 Share Posted April 15, 2008 Recommend me a good solid and secure member login system (so I can password protect certain areas of my new website). Some features I'd like would be access levels, or something so people can't just register and have access, but they must be validated first by an Administrator (like we see on many forums). I've looked around a lot for something good myself, and I am unable to write one alone as well, so I figured someone with more experience might be able to let me know of a good one I could use. Thanks to anyone who can help! Quote Link to comment Share on other sites More sharing options...
Coreye Posted April 16, 2008 Share Posted April 16, 2008 Hey, What exactly would the site be for? Have you looked into a CMS? Also, when you say "so I can password protect certain areas of my new website", can you be more specific? Do you mean like admin pages, etc? Quote Link to comment Share on other sites More sharing options...
Ondes Posted April 16, 2008 Author Share Posted April 16, 2008 Sorry for being so vague. In the past, CMS type systems like Joomla weren't really what I wanted, what I need is sort of more simpler. The site is for a gaming group, and by password protect certain areas, I mean I'd like to password protect a members directory, giving certain options only to those validated and registered. Thanks. Quote Link to comment Share on other sites More sharing options...
Ondes Posted April 17, 2008 Author Share Posted April 17, 2008 Any ideas on this? Quote Link to comment Share on other sites More sharing options...
Northern Flame Posted April 19, 2008 Share Posted April 19, 2008 i dont know of any free scripts out there that can do that for you, you might want to try the freelance section if you cant find anything. or if you want to learn how to do this yourself, it shouldn't be too difficult. heres one tutorial i found by doing a simple google search (its using PHP and MySQL) http://www.plus2net.com/php_tutorial/php_signup.php Quote Link to comment Share on other sites More sharing options...
Ondes Posted April 19, 2008 Author Share Posted April 19, 2008 Thanks for the tutorial I will try it. I have tried some others and would like to be able to learn PHP in general myself, specificaly this portion but I've found it quite daunting and difficult. Thanks again! Quote Link to comment Share on other sites More sharing options...
ardyandkari Posted April 21, 2008 Share Posted April 21, 2008 couldnt you have something like $SESSION[userlevel] or something? have a database where when the people log in it copies a user level into the session... then just require certain pages to have a certain userlevel if $SESSION[uSERLEVEL] > X echo 'You are not cool enough to view this page!'; else echo 'You are too cool for school!'; i might be wrong on this, if i am just tell me. Quote Link to comment Share on other sites More sharing options...
Northern Flame Posted April 22, 2008 Share Posted April 22, 2008 yup thats pretty much how you would do it, although $SESSION[userlevel] should be $_SESSION[userlevel] if you're using php, which im guessing you are. Quote Link to comment Share on other sites More sharing options...
trq Posted April 22, 2008 Share Posted April 22, 2008 yup thats pretty much how you would do it, although $SESSION[userlevel] should be $_SESSION[userlevel] if you're using php, which im guessing you are. And again (just nitpicking here) that would actually be $_SESSION['userlevel'] Quote Link to comment Share on other sites More sharing options...
Ondes Posted April 22, 2008 Author Share Posted April 22, 2008 Could you explain a bit more please. I'm just about 100% lost when it comes to PHP! Quote Link to comment Share on other sites More sharing options...
Northern Flame Posted April 22, 2008 Share Posted April 22, 2008 yup thats pretty much how you would do it, although $SESSION[userlevel] should be $_SESSION[userlevel] if you're using php, which im guessing you are. And again (just nitpicking here) that would actually be $_SESSION['userlevel'] LOL i didn't even notice that! oops! and $_SESSION stores session variables as an array, you can read more about it here: http://www.tizag.com/phpT/phpsessions.php or just to a google search on PHP and $_SESSION Quote Link to comment Share on other sites More sharing options...
Ondes Posted April 23, 2008 Author Share Posted April 23, 2008 Thanks, I am still confused though. It would seem I either need a tutorial for a member system with validation, or a downloadable one, or someone to walk me through. Thanks again. Quote Link to comment Share on other sites More sharing options...
Coreye Posted April 23, 2008 Share Posted April 23, 2008 There are a ton of 'User system' and 'Login Scripts' that are able to do what you are looking for. Just search Google. If you need help with them, just ask. Quote Link to comment Share on other sites More sharing options...
Ondes Posted April 23, 2008 Author Share Posted April 23, 2008 Thanks for responding. I'm sure and know there are many out there, but I personally have not been able to find one despite heavy searching, which is why I am asking out there for some help. Quote Link to comment Share on other sites More sharing options...
ardyandkari Posted April 23, 2008 Share Posted April 23, 2008 i had the same problem...any user login system that i found involved a bunch of junk that i didnt want to deal with. so, i came up with my own, and with the wonderful assistance of this community i customized it to my needs. that is the great thing about php. even a newcomer (like me) can get good code and helpful assistance for free. i am going to post my login system here, but you will need to take the effort to customize it yourself. dbconnect.php is a php file that connects you to the database. main php page: <?php session_start(); include "dbconnect.php"; //this checks to make sure that the user fills in the username and password fields if ((isset($_POST['user'])) || (isset($_POST['pass']))) { $user=$_POST['user']; $pass=$_POST['pass']; $sql="SELECT * FROM login WHERE username='$user' and password='$pass'"; $result=mysql_query($sql) or die ("Error in query" . mysql_error());// this will throw an error if there is one in the sql // Mysql_num_row is counting table row $count=mysql_num_rows($result); // If result matched $myusername and $mypassword, table row must be 1 row if($count==1){ // Register $myusername, $mypassword and redirect to file "login_success.php" $_SESSION['user'] = $user; $_SESSION['pass'] = $pass; echo 'protected page'; } if($count!=1) { echo '<div align="center">INCORRECT USERNAME AND/OR PASSWORD</div>'; include "loginform.php"; } } // close top if else {include "loginform.php";} ?> </body> </html> the following is the loginform.php: <?php echo ' <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Demonstration</title> </head> <body> <table width="300" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC"> <tr> <form name="form1" method="post" action="demo.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="user" type="text" id="user"></td> </tr> <tr> <td>Password</td> <td>:</td> <td><input name="pass" type="text" id="pass"></td> </tr> <tr> <td> </td> <td> </td> <td><input type="submit" name="Submit" value="Login"></td> </tr> </table> </td> </form> </tr> </table> </body> </html> '?> again, this is a script that i worked on to work for me. you will need to customize it to fit your needs. EDIT: also, i am pretty sure that this script is not secure AT ALL! i know nothing about security here, so that is something that you should read up on. Quote Link to comment Share on other sites More sharing options...
Ondes Posted April 25, 2008 Author Share Posted April 25, 2008 Thanks for all the help everyone. Problem is now solved, I worked out a clear simple .htaccess system with help from my host's support forums. Thanks again. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.