The register script, im sure you can do youself? Just create a form then create a page inputting the data into the database? My example from my site:
<?php
$error=NULL;
$time=time();
$check_username=mysql_query("select username from members where username='".$_POST['username']."'");
if ( mysql_num_rows($check_username) > 0) { $error .= "Sorry but that username is already being used!<br>"; }
if ($_POST['password1'] != $_POST['password2']) { $error .= "Sorry but your 2 passwords did not match!<br>"; }
if ( strlen($_POST['username']) > 15 ) { $error .= "Sorry but your username cannot be over 15 characters.<br>"; }
if ( empty( $_POST['username']) ) { $error.= "You must choose a username!<br>"; }
if ( empty( $_POST['password1']) OR empty($_POST['password2']) ) { $error.= "You must fill in both password fields!<br>"; }
if ( empty( $_POST['email']) ) { $error .= "You must enter an email address!<br>"; }
if ($error == NULL)
{
mysql_query("insert into members(username,password,email,location,datejoined,question1) values('".$_POST['username']."','".$_POST['password1']."','".$_POST['email']."','".$_POST['location']."','".$time."','".$_POST['question1']."')");
}
else { $error .= "<br>Please <a href='../register.php'>try again</a>!"; }
?>
The actual script which logs you in:
<?php
ob_start();
include("../includes/general.php");
include("../includes/connect_db.php");
$check_login=mysql_query("SELECT COUNT(*) AS is_member FROM members WHERE username='".$_POST['username']."' AND password='".$_POST['password']."'");
$row=mysql_fetch_assoc($check_login);
if ( $row['is_member'] == 1 )
{
session_register("username");
$username = $_POST['username'];
session_register("password");
$password = $_POST['password'];
session_register("logged_in");
$logged_in = 1;
$login_result = "<b>Thank you for logging in " . $_POST['username'] . "</b>";
$login_action = "<b><a href='".$_GET['referer']."?topicid=".$HTTP_SESSION_VARS['topicid']."&cat=".$HTTP_SESSION_VARS['cat']."'>Continue</a></b></font>";
header("Location: ".$_GET['referer']."?topicid=".$HTTP_SESSION_VARS['topicid']."&cat=".$HTTP_SESSION_VARS['cat']."");
unset($HTTP_SESSION_VARS['topicid'],$HTTP_SESSION_VARS['topicid']);
}
else
{
session_register("username");
$username = $_POST['username'];
session_register("password");
$username = $_POST['password'];
session_register("logged_in");
$logged_in = 0;
$login_result = "<font class=style5>Sorry but your username and password combination was incorrect!";
$login_action = "<b><a href='../login.php'>Try Again</a></b></font>";
header("Location: ../login.php?problem=1");
}
?>
The part which checks whether you are logged in or not on each page, using SESSION variables.
$check_login=mysql_query("SELECT COUNT(*) AS is_member FROM members WHERE username='".$_SESSION['username']."' AND password='".$_SESSION['password']."'");
$row=mysql_fetch_assoc($check_login);
if ( $row['is_member'] == 1 )
{ $logged_in=1; }
else
{ $logged_in=0; }
Thats the basic password script I use on my site, i'm not going to adapt it to your needs, just work over it slowly, understand what does what and it will be easy to modify, and if you get stuck again, post with a SPECIFIC question, not just DO THIS FOR ME BECAUSE IM LAZY. Sheesh the amount of people nowadays who expect code from no where. What stopped you taking it out of a cms system ect... ?? [/rant]
Jack.