General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old July 5th, 2003, 02:58 PM
Volitics Volitics is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Location: Knoxville, Tennessee (U.S.A.)
Posts: 58 Volitics User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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

Reply With Quote
  #2  
Old July 5th, 2003, 10:38 PM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Location: Sydney, AU
Posts: 2,058 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 8 m 57 sec
Reputation Power: 9
Send a message via ICQ to stumpy Send a message via MSN to stumpy
Spam bots don't look at your PHP source (Server side), they look at the final HTML output (client side).
__________________
DevArticles Moderator
BlueSix - Web Development and Consulting

Reply With Quote
  #3  
Old July 6th, 2003, 12:05 AM
Volitics Volitics is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Location: Knoxville, Tennessee (U.S.A.)
Posts: 58 Volitics User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 15 sec
Reputation Power: 6
stumpy;

Thank you for your help.

Best Regards;

Volitics

Reply With Quote
  #4  
Old July 6th, 2003, 05:24 AM
digitallysmooth digitallysmooth is offline
you know how we do
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jun 2002
Posts: 788 digitallysmooth User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 34 m 21 sec
Reputation Power: 7
Stumpy's answer is correct... however you still need a solution.
If I were working on this project my quick and dirty solution would be to write the part of the HTML that contains the email as javascript only after the the submit button is clicked. ( onclick ), then after writing the HTML you want to call this.submit() on the form. Hope this helps.
__________________
__________________________________________________ _
Wil Moore III, MCP | Integrations Specialist | Senior Consultant
Are You Listed...? | DigitallySmooth Inc.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > Will This Script Hide My Email Address From Spambots?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT