Jump to content

Can anyone...


Ondes

Recommended Posts

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!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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']

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.