|
Posted by Andy on 09/19/05 23:51
I made a script to write all posted data by a form in CSV file. I did also a
script to ban spammers IP Addresses. When banned spammer wants to use my
form ito send a letter he gets a warning message. Unfortunately all spammers
data he tried to send is recorded in CSV file. Please tell me how to modify
my script so the spammer will get a warning message but his data will not be
recorded after he press a send button. Thank you.
This is a script to record data to CSV file (letters.CSV).
$filename = "letters.csv";
touch ("$filename");
$fpc = fopen($filename, "a") or die ("Couldn't open $filename");
fputs($fpc,"\n\"$_POST[from],\"
$_POST[email],\"$_POST[message],");fclose($fpc);
This is a script to ban IP Addresses :
$ban_ip_on = "yes";
$ban_ip_list = "111.222.33.55,
11.33.777.99,";
if($ban_ip_on == "yes") {
if(strstr($ban_ip_list, $HTTP_SERVER_VARS[REMOTE_ADDR])) {
echo "<div align='center'><span class='contact6'> Error - Banned
IP</span><br><br><span class='cbull'>•
</span><span class='contact5'>
You cannot use this form because your IP address has been banned by the
administrator.</span><br><br><input type=button value='> > Close
Window < <'
onClick=javascript:closewindow(); name='button'></div>";
$error = "yes";
}
}
if($error == "yes") {
exit();
}
Navigation:
[Reply to this message]
|