Oh, OK. Did you try this for the code:
PHP Code:
$usernameErr = "";
$username = "";
if(isset($_POST['submit'])) {
if (empty($_POST["username"])) {
$nameErr = "Name is required";
} else {
$name = test_input($_POST["username"]);
}
}
function test_input($data) {
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}
and you said you added name="submit" to the submit button, right?
It's hard to tell if that's everything you need without seeing the big picture. Where are you putting that code, if that a plugin, or is reportuser.php a custom script? (I guess it's not a vbuletin file so that's probably it).