I am trying to set up a simple account creation form for a game. I'm going to post my HTML and PHP that is being used below.

What I want to do is block the following words from being entered into a characters name:

```
Mod, Owner, Mawd, M0d, 0wner

```

Also, I need to block special characters such as these:

```
!@#$%^&*()_+|\`~

```

Once those get blocked, my form will be 100% finished, unless I decide to change the template for it.

Here is the PHP code that checks the text entered into the form.

```
<?php //data.php
require_once 'login.php';

// Get values from form
$NAME        = $_POST['char_name'];
$PASS        = $_POST['char_pass']; 
$FORUM       = $_POST['forum_name'];
$TESTER      ="0";
$BANNED      ="0";
$RANK        ="1";

// Check if form is empty
if(trim($NAME) == '' || trim($PASS) == '' || trim($FORUM) == ''){
header('Location: http://www.runerecovery.us/ingame/notfilled.html');
}

// Check for duplicates
$query = mysql_query("SELECT * FROM accounts WHERE username='$NAME'");
if(mysql_num_rows($query) > 0){
header('Location: http://www.runerecovery.us/ingame/characterexists.html');
}else{

// Insert data into mysql
$sql="INSERT INTO accounts (username,password,forumname,tester,banned,rank)
VALUES ('$NAME','$PASS','$FORUM','$TESTER','$BANNED','$RANK')";
$result = mysql_query($sql);

// if successfully insert data into database, displays message "Successful".
if($result){
header('Location: http://runerecovery.us/ingame/registered.html');
}
else {
echo "ERROR";
}
}

```