adm
16-10-2006, 05:42 PM
Ok, again my site user system is playing up:-
http://habboit.info
or
http://xvisor.connect-hosting.com
If you try and register, fill out all the forms etc it says "some fields were left blank" or something like that.
Here's the register file:-
<html>
<head>
<title>Home</title>
<style type="text/css">
a {
font-size: 10px;
color: #000000;
}
a:link {
text-decoration: none;
color: #000000;
}
a:visited {
text-decoration: none;
color: #000000;
}
a:hover {
text-decoration: underline;
color: #000000;
}
a:active {
text-decoration: none;
color: #000000;
}
body,td,th,p {
font-family: Verdana;
font-size: 10px;
color: #000000;
}
.5 { color: #ff0000; font-weight: bold; }
.4 { color: #ff6600; font-weight: bold; }
.3 { color: #006600; font-weight: bold; }
.2 { color: #000099; font-weight: bold; }
.1 { color: #000000; }
input {
font-family: Tahoma, Arial;
font-size: 8pt;
font-weight: bold;
color: #000000;
background-color: #FFFFFF;
border: 1px solid #000000;
}
</style>
</head>
<body bgcolor="#EFEFEF">
Before you can use our User System you must register below.
</body>
</html>
<?php
ob_start();
// allows you to use cookies
include("config.php");
//gets the config page
if ($_POST[register]) {
// the above line checks to see if the html form has been submitted
$username = $_POST[username];
$password = $_POST[pass];
$cpassword = $_POST[cpass];
$email = $_POST[emai1];
//the above lines set variables with the user submitted information
if($username==NULL|$password==NULL|$cpassword==NUL L|$email==NULL|$checkbox==FALSE) {
//checks to make sure no fields were left blank
echo "A field was left blank.";
}else{
//none were left blank! We continue...
if($password != $cpassword) {
// the passwords are not the same!
echo "Passwords do not match";
}else{
// the passwords are the same! we continue...
$password = md5($password);
// encrypts the password
$checkname = mysql_query("SELECT username FROM users WHERE username='$username'");
$checkname= mysql_num_rows($checkname);
$checkemail = mysql_query("SELECT email FROM users WHERE email='$email'");
$checkemail = mysql_num_rows($checkemail);
if ($checkemail>0|$checkname>0) {
// oops...someone has already registered with that username or email!
echo "The username or email is already in use";
}else{
// noone is using that email or username! We continue...
$username = htmlspecialchars($username);
$password = htmlspecialchars($password);
$email = htmlspecialchars($email);
// the above lines make it so that there is no html in the user submitted information.
//Everything seems good, lets insert.
$query = mysql_query("INSERT INTO users (username, password, email) VALUES('$username','$password','$email')");
// inserts the information into the database.
echo "You have successfully registered!";
}
}
}
}
else
{
// the form has not been submitted...so now we display it.
echo ("
<form method=\"POST\">
<table border=\"0\" width=\"100%\">
<tr>
<td width=\"50%\">
Username: </td>
<td width=\"50%\"> <input type=\"text\" size=\"20\" maxlength=\"25\" name=\"username\"></td>
</tr>
<tr>
<td width=\"50%\">
Password: </td>
<td width=\"50%\"> <input type=\"password\" size=\"20\" maxlength=\"25\" name=\"pass\"></td>
</tr>
<tr>
<td width=\"50%\">
Confirm Password:</td>
<td width=\"50%\"> <input type=\"password\" size=\"20\" maxlength=\"25\" name=\"cpass\"></td>
</tr>
<tr>
<td width=\"50%\">
Email: </td>
<td width=\"50%\"> <input type=\"text\" size=\"20\" maxlength=\"50\" name=\"emai1\"></td>
</tr>
</table>
<p>
<input type='checkbox' name='checkbox' /> <a href='rules.php'>I have read, and agree with the rules</a><br />
<input name=\"register\" type=\"submit\" value=\"Register\">
</p>
</form>
");
}
?>
http://habboit.info
or
http://xvisor.connect-hosting.com
If you try and register, fill out all the forms etc it says "some fields were left blank" or something like that.
Here's the register file:-
<html>
<head>
<title>Home</title>
<style type="text/css">
a {
font-size: 10px;
color: #000000;
}
a:link {
text-decoration: none;
color: #000000;
}
a:visited {
text-decoration: none;
color: #000000;
}
a:hover {
text-decoration: underline;
color: #000000;
}
a:active {
text-decoration: none;
color: #000000;
}
body,td,th,p {
font-family: Verdana;
font-size: 10px;
color: #000000;
}
.5 { color: #ff0000; font-weight: bold; }
.4 { color: #ff6600; font-weight: bold; }
.3 { color: #006600; font-weight: bold; }
.2 { color: #000099; font-weight: bold; }
.1 { color: #000000; }
input {
font-family: Tahoma, Arial;
font-size: 8pt;
font-weight: bold;
color: #000000;
background-color: #FFFFFF;
border: 1px solid #000000;
}
</style>
</head>
<body bgcolor="#EFEFEF">
Before you can use our User System you must register below.
</body>
</html>
<?php
ob_start();
// allows you to use cookies
include("config.php");
//gets the config page
if ($_POST[register]) {
// the above line checks to see if the html form has been submitted
$username = $_POST[username];
$password = $_POST[pass];
$cpassword = $_POST[cpass];
$email = $_POST[emai1];
//the above lines set variables with the user submitted information
if($username==NULL|$password==NULL|$cpassword==NUL L|$email==NULL|$checkbox==FALSE) {
//checks to make sure no fields were left blank
echo "A field was left blank.";
}else{
//none were left blank! We continue...
if($password != $cpassword) {
// the passwords are not the same!
echo "Passwords do not match";
}else{
// the passwords are the same! we continue...
$password = md5($password);
// encrypts the password
$checkname = mysql_query("SELECT username FROM users WHERE username='$username'");
$checkname= mysql_num_rows($checkname);
$checkemail = mysql_query("SELECT email FROM users WHERE email='$email'");
$checkemail = mysql_num_rows($checkemail);
if ($checkemail>0|$checkname>0) {
// oops...someone has already registered with that username or email!
echo "The username or email is already in use";
}else{
// noone is using that email or username! We continue...
$username = htmlspecialchars($username);
$password = htmlspecialchars($password);
$email = htmlspecialchars($email);
// the above lines make it so that there is no html in the user submitted information.
//Everything seems good, lets insert.
$query = mysql_query("INSERT INTO users (username, password, email) VALUES('$username','$password','$email')");
// inserts the information into the database.
echo "You have successfully registered!";
}
}
}
}
else
{
// the form has not been submitted...so now we display it.
echo ("
<form method=\"POST\">
<table border=\"0\" width=\"100%\">
<tr>
<td width=\"50%\">
Username: </td>
<td width=\"50%\"> <input type=\"text\" size=\"20\" maxlength=\"25\" name=\"username\"></td>
</tr>
<tr>
<td width=\"50%\">
Password: </td>
<td width=\"50%\"> <input type=\"password\" size=\"20\" maxlength=\"25\" name=\"pass\"></td>
</tr>
<tr>
<td width=\"50%\">
Confirm Password:</td>
<td width=\"50%\"> <input type=\"password\" size=\"20\" maxlength=\"25\" name=\"cpass\"></td>
</tr>
<tr>
<td width=\"50%\">
Email: </td>
<td width=\"50%\"> <input type=\"text\" size=\"20\" maxlength=\"50\" name=\"emai1\"></td>
</tr>
</table>
<p>
<input type='checkbox' name='checkbox' /> <a href='rules.php'>I have read, and agree with the rules</a><br />
<input name=\"register\" type=\"submit\" value=\"Register\">
</p>
</form>
");
}
?>