index.php
<?php
?>
<html>
<p>
<head>
<LINK href="color.css" rel="stylesheet" type="text/css">
<script type="text/javascript" language="Javascript">
<!-- Copyright 2002 Bontrager Connection, LLC
//
// Type the number of images you are rotating.
NumberOfImagesToRotate = 8;
// Specify the first and last part of the image tag.
FirstPart = '<img src="pic';
LastPart = '.jpg" height="150" width="200">';
function printImage() {
var r = Math.ceil(Math.random() * NumberOfImagesToRotate);
document.write(FirstPart + r + LastPart );
}
//-->
</script>
<title>Register</title>
</head>
<h1>
.
</h1>
<body>
<center><h2>Users Online</h2>
<script type="text/javascript" language="Javascript"><!--
printImage();
printImage();
printImage();
printImage();
//--></script>
</center>
<h2>
Register
</h2>
<form action='register.php' method='POST'>
<table>
<tr>
<td>
Your full name:
</td>
<td>
<input type ='text' name='fullname'>
</td>
</tr>
<tr>
<td>
Email:
</td>
<td>
<input type ='text' name='useremail'>
</td>
</tr>
<tr>
<td>
Gender:
</td>
<td>
<input type ='radio' name='gender' id='gm' value='Male'
checked='checked' />Male
<input type ='radio' name='gender' id='gf' value='Female'
checked='checked' />Female
</td>
</tr>
<tr>
<td>
Choose a User Name:
</td>
<td>
<input type 'text' name='username'>
</td>
</tr>
<tr>
<td>
Choose a Password:
</td>
<td>
<input type ='password' name='password'>
</td>
</tr>
<tr>
<td>
Reapeat Password:
</td>
<td>
<input type ='password' name='repeatpassword'>
</td>
</tr>
</table>
<p>
<input type='submit' name='submit' Value='Register'>
</form>
</body>
</html>
register.php
<?php
$submit = strip_tags($_POST ['submit']);
$fullname = strip_tags($_POST ['fullname']);
$username = strip_tags($_POST ['username']);
$password = md5(strip_tags($_POST ['password']));
$repeatpassword = md5(strip_tags($_POST ['repeatpassword']));
$date = date("Y-m-d");
if ($submit)
{
if($fullname&&$username&&$password&&$repeatpassword)
{
if ($password==$repeatpassword)
{
if (strlen ($username)>25||strlen($fullname)>25)
{
echo "Max limit for username/fullname are 25 characters";
}
else
{
if (strlen ($password)>200||strlen($password)<6)
{
echo "Password must be between 6 and 25 characters";
}
else
{
$password = md5($password);
$repeatpassword = md5($repeatpassword);
//open database
$connect = mysql_connect("localhost","facebks","brianna123");
mysql_select_db("facebks_ingles"); //select database
$queryreg = mysql_query("
('','$fullname','$username','$password','$useremail','date')
");
die("You have been registerd! You will see a comfimation email!");
}
}
}
else
{
echo "Your passwords do not match!";
}
}
else
{
echo"Please fill in <b>all</b> fields!";
}
}
?>

New Topic/Question
Reply



MultiQuote





|