
July 5th, 2003, 02:58 PM
|
|
Contributing User
|
|
Join Date: Dec 2002
Location: Knoxville, Tennessee (U.S.A.)
Posts: 58
Time spent in forums: 5 m 15 sec
Reputation Power: 6
|
|
|
Will This Script Hide My Email Address From Spambots?
Below is (a part of) a script that I am using on my web site. In order to guard against "spambots" I am including my email address in the " email_address.inc.php" require file.
I have the " conf" directory password protected. A "spambot" crawler can't get to it from a direct call (I don't think) because the directory is password protected.
The script below will call the " email_address.inc.php" file just fine from the password protected directory.
The "Submit" button has to be activated and the input in the " $FirstName" and the " $LastName" input boxes has to be in the right format before the " email_address.inc.php" file will be called (using the code in the script).
My question is this: Does anybody see how a "spambot" could get into my " email_address.inc.php" file the way I have the code written below?
PHP Code:
if ($_POST[Submit]){
if (eregi ("(.{1,25})", $_POST[FirstName])) {
$a = TRUE;
} else {
$a = FALSE;
}
if (eregi ("^(.{1,25})+$", $_POST[LastName])) {
$b = TRUE;
} else {
$b = FALSE;
}
if ($a AND $b) {
require_once "./conf/email_address.inc.php";
} else {
echo "Nope, you're not allowed here.";
}
}else{
echo "<form method=\"post\" action=\"$PHP_SELF\">";
echo "<input type=\"text\" name=\"FirstName\" value=\"$FirstName\" size=\"15\" maxlength=\"25\"><p>";
echo "<input type=\"text\" name=\"LastName\" value=\"$LastName\" size=\"15\" maxlength=\"25\"><p>";
echo "<input type=\"submit\" name=\"Submit\" value=\"Click Here To Proceed\">";
echo "</form>";
}
Thanking you in advance.
Volitics
|