Ah sorry will do from now on.
Well i have changed the error tags and now it just gets my last variable echo of "Please try again" everytime i enter any data.
Thanks for any help
<?php
if (eregi ('^[[:alpha:]\.\'\-]{2,15}$', stripslashes(trim($_POST['first_name'])))) {
$fn = mysql_real_escape_string($_POST['first_name']);
}
else
{
$fn = FALSE;
echo '<p><font color ="red" size="+1"> Please enter your first name!</font></p>';
}
if (eregi ('^[[:alpha:]\.\'\-]{2,30}$', stripslashes(trim($_POST['last_name'])))) {
$fn = mysql_real_escape_string($_POST['last_name']);
}
else
{
$ln = FALSE;
echo '<p><font color ="red" size="+1"> Please enter your last name!</font></p>';
}
if (eregi ('^[[:alnum:]][a-z0-9_\.\-]*@[a-z0-9\.\-]+\.[a-z]{2,4}$', stripslashes(trim($_POST['email'])))) {
$e = mysql_real_escape_string($_POST['email']);
}
else
{
$e = FALSE;
echo '<p><font color ="red" size="+1"> Please enter a correct e-mail address</font></p>';
}
if (eregi ('^[[:alnum:]]{4,20}$', stripslashes(trim($_POST['password1'])))) {
if ($_POST['password1'] == $_POST['password2']) {
$p = mysql_real_escape_string($_POST['password1']);
}
else
{
$p = FALSE;
echo '<p><font color ="red" size="+1"> Your password did not match the confirmed password!</font></p>';
}
}
else
{
$p = FALSE;
echo '<p><font color ="red" size="+1"> Please enter a valid password!</font></p>';
}
if ($fn && $ln && $e && $p) {
$query ="SELECT username FROM users WHERE email='$e'";
$result = mysql_query ($query) or trigger_error("Query: $query\n<br />MySQL Error: ".mysql_error());
if (mysql_num_rows($result) == 0) {
$a = md5(uniqid(rand(), true));
$query = "INSERT INTO users (email, pass, first_name, last_name, active, registration_date) VALUES ('$e', '$p', $'f', $'ln', $'a' )";
$result = mysql_query ($query) or trigger_error("Query: $query\n<br />MySQL Error:" .mysql_error());
if (mysql_affected_rows() == 1) {
$body = "Thank you for registering with Football Trip. Please use the link below to activate your account:\n\n";
$body .= "http://www.footballtrip.net/activate.php?x=" . mysql_insert_id() . "&y=$a";
mail($_POST['email'],'Registration Comfirmation',$body);
echo '<h2> Thank you for registering! A confirmation E-Mail has been sent to your address. Please click on the link in
order to activate your account</h2>';
}
else
{
echo '<p>font color="red" size="+1"> You could not be registered due to a system error. We apologize for any inconvenience. </font></p>';
}
} else {
echo '<p><font color="red" size="+1"> That E-Mail address has already been registered. If you have forgotten your password, use the link to have your password sent to you.</font></p>';
}
} else {
echo '<p><font color="red" size="+1"> Please try again.</font></p>';
}
mysql_close();
?>