PDA

View Full Version : A login form Script????


graywolf
02-22-2006, 07:25 PM
I need a good login script for my web site Or a way to make one. Can someone plz post a tutorial on how to make a good login form useing a php document or a good script for one.

Thanks

MrSpandex
02-23-2006, 05:53 AM
I was going to go looking for one of these myself. I considered simply posting info, searching the db, matching the password, and posting the name to the pages that required login. But it seems a little insecure.

graywolf
02-23-2006, 06:54 AM
Well i didn't quite understand what you meant??? If you mean to search the forums I did that already. If you meant make a forum using basic info like knowing the login and password thats not going to work for my site. I need a login script that recodes regesteried users like int he forums. You have to sign up and login in to go to certain pages and to do certain things. EX: Logining in to view upcoming events or other info that is avaliable to only members.
This is what i need a data base

MrSpandex
02-23-2006, 07:51 AM
Sorry, I realize its unclear now. I was describing how I would make a login script. Its probably too simple for your use. :cool:

PsychoticDude85
02-23-2006, 08:26 AM
Search for a tutorial on Google or look for one on http://pixel2life.com/ they have an archive of PHP tutorials, so there ought to be one there.

sandeepji
07-21-2010, 10:16 PM
Hi, Before introduce an script, I just want to clear all basic concept to all of you,
How a php script Run ?
Web - Browser => Web - Server => PHP - Engine =>MySql Server.
In short I Explain here that, first you write source code in web - browser, then it send to server,which add some functionality in them, later it goes to php engine where that's check some php - syntax, html code, as well as it open Database Connection ,later it goes to mysql server, where all the query execute by that part, after that, we get output at Web Browser in that way.
Web - Browser <= Web - Server <= PHP - Engine <=MySql Server.

:)
Now the script save in C:/D:/E:/F:/Drive =>wamp =>www =>index_dir.php
*********************************
******************
*********
<?php
if(isset($_POST['posted']))
{
$name=$_POST['dir_username'];
$pass=$_POST['dir_password'];
$connect=mysql_connect('localhost','root','');
$db=mysql_select_db('dir_db',$connect);
$query=mysql_query('SELECT * FROM dir_login',$connect);
while($row=mysql_fetch_array($query))
{
$column1=$row['username'];
$column2=$row['password'];
if($column1 == $name && $column2 == $pass)
{
header('location:registration_dir.php');
}
else
{
echo('Sorry Username and password is mismatch');
exit();
}
}
}

?>

<form name="index_dir" method="post" action="index_dir.php">
<table align="center" border="">
<tr>
<td>
<b style="background-color:#063">USERNAME</b>
<input type="text" name="dir_username" value="USERNAME" style="background-color:#966">
</td>
</tr>
<tr>
<td><b style="background-color:#063">PASSWORD</b>
<input type="password" name="dir_password" value="*****" style="background-color:#966">
</td>
</tr>
<tr>
<td><input type="hidden" name="posted" value="true>"></td>
<td>
<input type="submit" name="dir_submir" value="GO" style="background-color:#063">
</td>
</tr>
</table>
</form>
I thinks that's enough for you.
:(