Could anyone tell me whats wrong with the following code please?
Error message : Parse error: syntax error, unexpected T_ELSE in C:\xampp\htdocs\Website\registernext.php on line 35
[php]<?php
include(‘confff.php’);
$testname = $_POST[‘username’];
if(!preg_match(’/[^a-z0-9]/i’,$testname) ) //test to see the username is alphanumeric
{
$query = "SELECT * FROM users WHERE username=".$_POST["username"]; //test for dupilcate names
$result = mysql_query($query);
$num = mysql_num_rows($result);
}
if ($num == 0)
{
}
else
{
header(“location:nameinuse.html”);
}
else
{
header(“location:invalidname.html”);
}
?>[/php]
