is this what you want? take it if it can help you ^^
I 've done it but I 'm not sure it will work :p:p:p:p
anyway, good luck with your job!
You need design user_no column to auto fill
Mysql.php
<?php
$db_host = "localhost";
$db_name = 'account';
$db_username = 'root';
$db_password = '123456';
@
[Only registered and activated users can see links. Click Here To Register...]_connect("{$db_host}", "{$db_username}", "{$db_password}") or die("Cant connect database");
@
[Only registered and activated users can see links. Click Here To Register...]_select_db("{$db_name}") or die("cant select database");
?>
Register.php
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Register Dekaron</title>
<?php
require_once("mysql.php");
//Check Email
function check_email($email) {
if (strlen($email) == 0) return false;
if (eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$", $email)) return true;
return false;
}
if ( $_GET['act'] == "do" )
{
$username = addslashes( $_POST['username'] );
$password = md5( addslashes( $_POST['password'] ) );
$email = addslashes( $_POST['email'] );
if ( ! $username || ! $_POST['password'] || ! $email)
{
print "Please enter complete information. <a href='javascript:history.go(-1)'>Go back</a>";
exit;
}
// check username
if ( mysql_num_rows(mysql_query("SELECT username FROM user_profile WHERE username='$username'"))>0)
{
print "This username is already taken. <a href='javascript:history.go(-1)'>Go back</a>";
exit;
}
// check email
if (!check_email($email))
{
print "This email is invalid. <a href='javascript:history.go(-1)'>Go back</a>";
exit;
}
// check email
if ( mysql_num_rows(mysql_query("SELECT user_mail FROM user_profile WHERE user_mail='$email'"))>0)
{
print "This email is already taken. <a href='javascript:history.go(-1)'>Go back</a>";
exit;
}
// Start making accounts
@$a=mysql_query("INSERT INTO user_profile (user_id, user_pwd, user_mail) VALUES ('{$username}', '{$password}', '{$email}')");
@$a1=mysql_query("INSERT INTO Tbl_user (user_id, user_pwd, user_mail) VALUES ('{$username}', '{$_POST['password']}', '{$email}')");
// Notifications complete account creation
if ($a)
print "account {$username} has been created. <a href='javascript:history.go(-1)'>Go back</a>";
else
print "There is an error in the application process , please contact with us";
}
else
{
// Form
print <<<EOF
<form action="register.php?act=do" method="post">
<table border="1" width="400" cellspacing="1" style="border-collapse: collapse" bordercolor="#C0C0C0">
<tr>
<td>Account:</td>
<td><input type="text" name="username" value=""></td>
</tr>
<tr>
<td>Password:</td>
<td><input type="password" name="password" value=""></td>
</tr>
<tr>
<td>E-mail:</td>
<td><input type="text" name="email" value=""></td>
</tr>
<tr>
<td><input type="submit" name="submit" value="Create Account"></td>
</tr>
</table>
</form>
EOF;
}
?>