Printer Friendly Version Print this thread
Email this thread to a friend eMail this thread to a friend
  • Parsing of any sites in convenient form (grab, inf (In: Professionals Corner)
  • what is best php or html? (In: General Search Engine Optimization)
  • Featured Web Site Template

    Hundreds More at Free Site Templates.com!

    Web Site Partners
    Sponsored Links
    Jet City Software
     
    Whos Here ?
    There are 0 guests and 1 members in the forums right now.
    Reflects user activity within the last 5 minutes
    Moderator(s): Prowler, jcokos
    Member Message

    dpeddle
    Joined: Eons Ago
    # Posts: 269

    View the profile for dpeddle Send dpeddle a private message

    Posted: 2005-Sep-12 21:17
    Edit Message Delete Message Reply to this message

    One of my clients is getting hit with 100 fake emails filling out his webform everyday using emails lke ghsahas @ hisdomain.com

    I have 2 ideas but need some help oimpementing them:

    1) PHP function to chenck $Email to see if the domain is his domain.... if it is... reject the email. This is because all of the fakes use his domain name.

    2) How to install a captcha (?) ... the image security script that many forms now use... i would like one that does not require a database.





    lizardz
    Joined: Nov 12, 2004
    # Posts: 1394

    View the profile for lizardz Send lizardz a private message

    Posted: 2005-Sep-12 23:01
    Edit Message Delete Message Reply to this message

    Yes, I just had that problem, it's actually not that hard to fix.

    I just added this code right before the main error detection component:

    $error = '';

    ........ get all the email form data

    $ems = '';

    // stop email server hacks
    $ems .= $message;
    $ems .= $subject;
    $ems .= $address;

    if ( stristr( $ems, 'content-type:' ) ¦¦ stristr( $ems, 'multipart/mixed' ) ¦¦ stristr( $ems, 'boundary="' ) ¦¦ stristr( $ems, 'cc:' ) ¦¦ stristr( $ems, 'multi-part message in mime format' ) ¦¦ stristr( $ems, 'to:' ) ¦¦ eregi( "(%[a-f0-9])", $ems ) ¦¦ stristr( $ems, '0x' ))
    // the last two are in case they try using hex or other non standard characters
    {
    $error .= "<p>Don't bother</p>";
    }

    if ( $error )
    {
    echo $error;
    }
    else
    {
    ...... finish email sending

    Those guys are using what's called email injection, where they simply inject into your form fields using an automated bot extra header information so your script can be used to send out spam.

    There are other ways to deal with it, this one seems to be working fine.

    Replace the ¦¦ with standard pipe characters, not broken.


    [ Message was edited by: lizardz 09/12/2005 04:46 pm ]





    redgtsviper
    Joined: Feb 27, 2006
    # Posts: 3

    View the profile for redgtsviper Send redgtsviper a private message

    Posted: 2006-Feb-28 03:26
    Edit Message Delete Message Reply to this message

    How can this be added to my code. I am new to PHP, It is still greek to me.

    Here is my code

    <?php
    $msg = "My Website Online Contact Submissionn";
    $msg .= "Name: $namen";
    $msg .= "Comments: $emailAddressnn";
    $msg .= "Comments: $phonenn";
    $msg .= "Comments: $messagenn";

    // Edit if it is nessecery
    $to = "$toaddress";
    $subject = "CONTACT PAGE FROM WEBSITE";
    $mailheaders = "From: Website Submission Form <$emailAddress>n";
    $mailheaders .= "Reply-To:$Email_Address <$emailAddress>nn";
    // Mail to address
    mail ( $to, $subject, $msg, $mailheaders );

    ?>


    You are not permitted to post messages in this forum or topic, because of one or more of the following reasons:
    1. You have not yet logged in, or registered properly as a member
    2. You are a member, but no longer have posting rights.
    3. This is a private forum, for which you do not have permissions.

    If you are a recent member, it's possible that you simply have not yet confirmed your account. Please check your email for a message entitled 'JimWorld Forums: Confirm Your Account' and follow the instructions contained within.

    If you cannot find this message, click here to Re-Send it.

    If you are still experiencing problem, please read the Login Assistance Article for some advice on what may be causing your login not to work properly.

    Switch to Advanced Editor and ... Create a New Topic or Reply to this Thread

    New posts Forum is locked
    © 1995  ·  iWeb, Inc  ·  DBA JimWorld Productions