see if this code works
and I noticed you you put an if statement $username>1? Did you mean $checkusername? And I couldn't figure out what you meant with if($email>0$conemail>0){ so I just put &&
<?php
ob_start();
//allow to add cookies
include("config.php");
//database things
if ($POST='register') {
//for the html form later on
$username = $_POST['username'];
$password = $_POST['password'];
$conpassword = $_POST['conpassword'];
$email = $_POST['email'];
$conemail = $_POST['conemail'];
$firstname = $_POST['firstname'];
$location = $_POST['location'];
if ($username==NULL|$password==NULL|$conpassword==NULL|$email==NULL|$conemail==NULL|$firstname==NULL|$location==NULL){
echo "Please fill in all flids";
}else{
if($password>0|$conpassword>0){
echo "passwords dont match!";
}else{
$password = md5($password);
$checkusername = mysql_query("SELECT 'username' FROM 'users2' WHERE username='$username'");
$checkusername = mysql_num_rows($checkusername);
$checkemail = mysql_query("SELECT 'email' FROM 'users2' WHERE email='$email'");
$checkemail = mysql_num_rows($checkemail);
$conemail = mysql_query("SELECT 'conemail' FROM 'users2' WHERE conemail='$conemail'");
$conemail = mysql_num_rows($conemail);
$checkfirstname = mysql_query("SELECT 'firstname' From 'users2' WHERE firstname='$firstname'");
$checkfirstname = mysql_num_rows($checkfirstname);
$checklocation = mysql_query("SELECT 'location' FROM 'users2' WHERE location='$location'");
$checklocation = mysql_num_rows($location);
if($username>1){
echo "username in use!";
if($email>0|$conemail>1){
echo "Emails dont match!";
if($email>1|$conemail>0){
echo "Emails dont match!";
if($email>0 && $conemail>0){
echo "Email is in use!";
}else{
//if all ok
$username = htmlspecialchars($username);
$password = htmlspecialchars($password);
$email = htmlspecialchars($email);
$firstname = htmlspecialchars($firstname);
$location = htmlspecialchars($location);
// NO html things submitted in the form!
//time to put it into database
$query = mysql_query("INSERT INTO 'users2' (username, password, email, firstname, location) VALUES ('$username', '$password', '$email', '$firstname', '$location')");
//all in database ^^^
//DONE MESSAGE!!
echo "you have successfully registered to (website name) theses are you detials:;
$_POST[username]<br>;
$_POST[password]<br>;
$_POST[email]<br>";
}
}
}
}
}
}
}
else
{
//show the form
echo ("
<center>
<form method=\"POST\">
Username: <input type=\"text\" size=\"15\" maxlength=\"25\" name=\"username\"><br />
Password: <input type=\"password\" size=\"15\" maxlength=\"25\" name=\"pass\"><br />
Confirm Password: <input type=\"password\" size=\"15\" maxlength=\"25\" name=\"cpass\"><br />
Email: <input type=\"text\" size=\"15\" maxlength=\"50\" name=\"emai1\"><br />
Confim Email: <input type=\"text\" size=\"15\" maxlength=\"50\" name=\"conemail\"<br />
First Name: <input type=\"text\" size=\"15\" maxlength=\"25\" name=\"firstname\"<br />
Location<input type=\"text\" size=\"15\" maxlength=\"50\" name=\"location\"<br />
<input name=\"register\" type=\"submit\" value=\"Register\">
</form>
</center>
");
}
?>