you will see i have a check to see if the username is blank or not.... right now it will print the echo line then complete the code and add it to the database.. i could do a
exit();
but then it will not do my final include files on my page... does anyone know how i can stop the code if the username is blank but still continue to display the rest of my html and include files down further on the page?
<?php
if ($username == "")
{
echo "INPUT ERROR: Heading cannot be greater than 255 characters in length";
}
$check = "select id from members where username = '".$_POST['username']."';";
$qry = mysql_query($check) or die ("Could not match data because ".mysql_error());
$num_rows = mysql_num_rows($qry);
if ($num_rows != 0) {
echo "Sorry, there the username $username is already taken.<br>";
echo "<a href=signup.php>Please go back and try again</a>";
} else {
$result = mysql_query ("INSERT INTO members (`id`,`username`,`firstname`,`lastname`,`dob`,`address`,`city`,`country`,`phone`,`email`,`password`,`nz_mailing`,`active`,`warriors_mailing`,`bcc_mailing`,`level`) Values('','$username','$firstname','$lastname','$dob','$address','$city','$country','$phone','$email','$password','$nz_mailing','$active','$warriors_mailing','$bcc_mailing','$level')") or die("INSERT error: ".mysql_error());
echo "Thanks $firstname, we have sent you a email with your account details.";