View Single Post
Old 03-23-2006, 12:16 AM   · #8
sacx13
NamePros Regular
 
Trader Rating: (8)
Join Date: Mar 2006
Posts: 394
NP$: 211.38 (Donate)
sacx13 is on a distinguished road
Another simple code

My code is reading the passwords from a simple file. The user and passwords are delimited by comas. Ex
user1,pass1
user2,pass2

PHP Code:
<?php
$username
=$_POST['username'];
$password=$_POST['password'];
$handle = fopen('/etc/php.pas',"r");

while(!
feof($handle))
{
$line = fgets($handle,1024);
list(
$u,$p) = explode(',',$line);

$u = trim($u);
$p = trim($p);
    if (
$username!="")
    if (
$username==$u && $password==$p)
    {
        
// just add your session cookies here and etc.
        
header("Location: test.html");
        exit();
    }
}

fclose($handle);
?>


Please register or log-in into NamePros to hide ads
sacx13 is offline   Reply With Quote
Site Sponsors
http://www.domainate.com/y/ SocialDN.com http://www.domainate.com/y/
Advertise your business at NamePros
All times are GMT -7. The time now is 05:07 PM.


Powered by: vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.