For the html problem just do this, it will remove all HTML tags from the string
$message = strip_tags($_POST['message']);
For the email problem I suggest you make a new table in your database name it whatever you want. Within it have. banned_id(Primary, auto inc), banned_email(varchar), banned_reason(text)
now create a form that allows you to add said user into that database, you should know how to do this already.
Its untested but it should work.
if (!empty($email)) {
$select = "SELECT banned_email FROM banned_users WHERE banned_email = $email";
$result = mysqli_query($dbc, $select);
if (mysqli_num_rows($result) <= 0 ) {
//pass
$select = "INSERT INTO feedback (first_name, last_name, email, `like`, message) " .
"VALUES ('$first_name', '$last_name', '$email', '$like', '$message')";
$result = mysqli_query($dbc, $query) or die('Error querying database.');
} else {
//fail
unset($select,$result);
}
} else {
}
Ok i'll run you through it.
- $select var is your query string that selects the col banned_email from your banned_users database
- $result is obvious
- First conditional takes the $result var and counts the number of rows returned, if there is a banned email in that database it will return atleast 1.
When it goes to your conditional the two vars $select and $result are overwritten with new values so dont worry about that.
If it fails the script releases the vars used to be used elsewhere, just incase.
This script is in NO WAY perfect or secure. You should research how to validate user input via forms, and php security. Because by the sounds of your problem you've been hit by a bot or something.
Also think about learning about captchas.
Hope this helps.