now that my database and php is working right for me i was looking around for a login script and every one i find dont wanna work right.....does any have a login script that they may wanna share ? ...or know of a good login script? and where i can get it ?
bejayel
01-09-2006, 05:18 AM
ok you are probably wanting th ewhole shabang correct??? Registration, login, and all. I dont really open up my scripts to people, but if you want help writing one, (which i woudl suggest), i think everyone on the board would be most helpful.
Douglas
01-09-2006, 05:40 PM
I made one you can mess around with one, I'll pm you ;)
snikerz79
01-09-2006, 08:37 PM
Good script is called vSignup, search Hotscripts.com for it. Its registration, login, and admin controls.
i got my login script working and i was wanting to know the code for placeing a welcome message on the page when they login that says there user name ....so it would be somthing like ....Welcome to my website "UserName".....how would i do this?
putnamehere
01-11-2006, 06:50 PM
Dose the login script use sessions? post your code from the login file?
here you have it:
<body bgcolor="#000000" text="#FFFFFF" link="#FF0000">
<img src="pics/drinkyloggedin.gif" width="144" height="163"><?php
ob_start();
include("config.php");
// connect to the mysql server
$link = mysql_connect($server, $db_user, $db_pass)
or die ("Could not connect to mysql because ".mysql_error());
// select the database
mysql_select_db($database)
or die ("Could not select database because ".mysql_error());
$match = "select id from $table where username = '".$_POST['username']."'
and password = '".$_POST['password']."';";
$qry = mysql_query($match)
or die ("Could not match data because ".mysql_error());
$num_rows = mysql_num_rows($qry);
if ($num_rows <= 0) {
echo "Sorry, there is no username $username with the specified password.<br>";
echo "<a href=login.html>Try again</a>";
exit;
} else {
setcookie("loggedin", "TRUE", time()+(3600 * 24));
setcookie("mysite_username", "$username");
echo "You are now logged in!<br>";
echo "Continue to the <a href=members.php>members</a> section.";
}
ob_end_flush();
?>