I am new with php and here is a simple guessbook page but I am being hit with spam from a group of the same email. I know I need to do an IF statement but I am kinda foggy on how to do the code.
What I want to do is make an file that has email address that I want to block and code to call it up to make sure the people that are signing it is not one of the spamers.
Here is my code for the page. Just need help on where to nest the code to call up the blocked email to stop them from posting.
Also if any one knows how to disable html coding from being displayed as well would be helpful.
Line number On/Off | Expand/Contract <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head> <title>Feed Back</title> <? include "data/head.php"; ?><body><center><table width="700" border=".01" cellspacing="0" cellpadding="0"><tr><td height="182" align="center" valign="bottom"><P ALIGN=CENTER><P ALIGN=CENTER><IMG SRC="Images/title/feedback2.gif" NAME="graphics10" ALT="About Me" ALIGN=BOTTOM WIDTH=500 HEIGHT=100 BORDER=0>
</p> <?php include "data/menu.php"; ?></td></tr><tr><td height="1050" align="left" valign="top"> <center><h2>Feedback Form</h2></center> <p>Share your feedback with me.</p> <form method="post" action="feedback.php"> <label for="firstname">First name:</label> <input type="text" name="firstname" /><br /> <label for="lastname">Last name:</label> <input type="text" name="lastname" /><br /> <label for="email">What is your email address?</label> <input type="text" name="email" /> Required<br /> <label for="like">Do you like my website, if no please tell me why?</label>
Yes <input name="like" type="radio" value="does" /> No <input name="like" type="radio" value="does not" /><br /> <label for="message">Your Feed Back</label> <textarea rows="8" cols="40" wrap="virtual" name="message"></textarea><br /> <input type="submit" value="Submit Feedback" name="submit" /> </form> <br /> <?php $first_name = $_POST['firstname']; $last_name = $_POST['lastname']; $email = $_POST['email']; $like = $_POST['like']; $message = $_POST['message']; $dbc = mysqli_connect('172.23.50.3', 'username', 'password', 'website') or die('Error connecting to MySQL server.'); if (!empty($email)) { $query = "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 { } // Retrieve data base $query = "SELECT * FROM feedback" ; $data = mysqli_query($dbc, $query); // Loop through the array of payment data while ($row = mysqli_fetch_array($data)) { // Display the payment data echo '<strong>' .$row['last_name'] . ' ' . $row['first_name'] . '</strong><br />' ; echo 'This person ' . $row['like'] . ' like this site. <br />'; echo '<strong>What this person had to say:</strong>' . '<br />'; echo $row['message'] . '<br />'; echo '<br />' ;} mysqli_close($dbc); ?> </td></tr> <tr> <td colspan="2" height="280"valign="top"><p align="center"> <?php include "data/footer.php";?> </td> </tr></table></body></html>
Thanks
Header is not working in IE
Hi ! header function is not working in IE but it works in FF, Safari, Chrome. any help please. :if (isset($_POST['sub1'])) { $id = $_POST['cscstest']; $qty = $_POST['cscsqty']; $id =
Do something every fifth time?
I'm trying to write a loop, but I want it to do something different after every fifth instance. Like, I want it do something like this:Quoteecho $a1;echo $a2;echo $a3;echo $a4;echo $a5.$b;echo $a6;And
SCRIPT ERROR
Here is the CONTACT FORM I made for our website:<form id="form1" name="form1" method="post" action=""> <table width="528"
filesize() returns 0
I have a socket program that runs in an infinite loop, listening for connections, in this socket I have a method, that is supposed to open a file and write to the file, but I am having issues. Each
Stuck with preg_replace
Hi,I'm trying to use preg_replace to remove part of the IP address submitted using a form on my website. The full IP is entered into my SQL database, but when printing it on the website I want to
Not sure why this script is not working?
Hi I am new to php programing and I was trying to make up a simple script like a captcha but I cannot get the validation part of it working. I think it should work but it is not. Anyone know what is
mod_rewrite.c on windows ??
why it's not working on windows while it's working on other hosts??? this is the code i got from a tutorial :Code: <IfModule mod_rewrite.c>RewriteEngine OnRewriteBase /rewriterule
How to insert random unique values in 2 columns ?
I have table with 2 columns
Different payment methods with different cross company requirements in F110
We are implementing SAP in a company in the shipping industry. They have the following requirement:
Limiting uploaded file type
I am working on a simple upload script, and I need it to limit the allowed file type that is uploaded to only .mpr files. .mpr files are not a MIME file type so I do not know how to limit it. Any