View Full Version : Resolved Login Script that uses mysql
josh.legogeek
03-22-2009, 03:06 PM
Hi,
I'm looking for a FREE php script that uses mysql to make a login page. I would like one that has a create your account page. Right now I am using ezUserManager, but it does not work well.
Thanks!
glambert
03-25-2009, 03:40 PM
this php code will check a posted username and password in a users table on mysql. if you need a full script the message me
<?php
session_start();
if(isset($_POST['login'])){
if(!empty($_POST['username']) && !empty($_POST['password'])){
mysql_connect('host', 'user', 'pass');
mysql_select_db('database');
$q=mysql_query("select * from users where username = '".$_POST['username']."' and password = '".$_POST['password']."' limit 1") or die(mysql_error());
if(mysql_num_rows($q) != '1'){
die('user not found');
}else{
$_SESSION['logged_in']='1';
header("Location: /home.php");exit();
}
}
session_write_close();
?>
josh.legogeek
03-25-2009, 08:39 PM
I might be able to work with that, but I found an xml one that works fine.
Thanks anyways!
vBulletin® v3.8.1, Copyright ©2000-2012, Jelsoft Enterprises Ltd.