1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Need To Add More Security To My Php Form

Discussion in 'PHP' started by Bohra, Oct 28, 2009.

  1. #1
    I Have A Free Lockerz Invite site basically its a php form which sends an email to me if some1 enters thier email and also saves in the db..

    I Have created a function that stops badwords but how would i stop spam... like s;dfd sfssff such words ?? dont wanna add a captcha any other way ??

    Lemme know
     
    Bohra, Oct 28, 2009 IP
  2. techbabu

    techbabu Peon

    Messages:
    20
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Use Adobe's (GetSQLValueString) this is the best function to stop sql injections and other things.

    TechBabu
    ------------
    Don't just make a website: Make an impact
     
    techbabu, Oct 28, 2009 IP
  3. organicCyborg

    organicCyborg Peon

    Messages:
    330
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #3
    If stopping spam if your goal, add in a captcha.

    reCAPTCHA is the standard these days, and really easy to add to any form.

    I looked at the link you posted, are you just gathering an email address? If so, you can just use a regex to check for a valid email and then insert into the DB and send the email.
     
    organicCyborg, Oct 28, 2009 IP
  4. Bohra

    Bohra Prominent Member

    Messages:
    12,573
    Likes Received:
    537
    Best Answers:
    0
    Trophy Points:
    310
    #4
    Well basically yes i do a check if the email is valid but then this can be cheated by entering something like or something like that..

    Is there any other kind of security other than captcha
     
    Bohra, Oct 29, 2009 IP
  5. wd_2k6

    wd_2k6 Peon

    Messages:
    1,740
    Likes Received:
    54
    Best Answers:
    0
    Trophy Points:
    0
    #5
    wd_2k6, Oct 29, 2009 IP
  6. organicCyborg

    organicCyborg Peon

    Messages:
    330
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I think the best thing to do to prevent these fake emails from making it into your DB is to send out a confirmation email. It's a pain in the ass, but the only real way you can confirm an email address.

    wd_2k6: Wow, I was really excited by that program. But, I couldn't get it to work on my server with a few email providers. Plus, it's still in an alpha release. I'm not sure how well it would work to begin with, since hwat it's doing really isn't a supported feature of SMTP
     
    organicCyborg, Oct 29, 2009 IP
  7. wd_2k6

    wd_2k6 Peon

    Messages:
    1,740
    Likes Received:
    54
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Yep I haven't used it myself yet, but there's still some work to do with it.

    would pass a DNS check so you must use an SMTP check for real exsistance, but as added it's not really supported and loading times will vastly increase!!
     
    wd_2k6, Oct 29, 2009 IP
  8. phatuis

    phatuis Peon

    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Maybe you could store there email in a database, along with a code and an activated column, default is 1, and you send them an email with the code, which is created using mt_rand(), and when they click it it will take them to an activate page, which will check the code against the username, where active = 0, and then it updates active to 1, which then in turn notifies you that someone has activated their account.
     
    phatuis, Oct 29, 2009 IP
  9. Bohra

    Bohra Prominent Member

    Messages:
    12,573
    Likes Received:
    537
    Best Answers:
    0
    Trophy Points:
    310
    #9
    The problems will emails nowadays is they go to spam sometimes dont even reach that pretty much sucks but i guess its a nice idea to prevent spam..
     
    Bohra, Oct 29, 2009 IP
  10. mike30

    mike30 Well-Known Member

    Messages:
    883
    Likes Received:
    34
    Best Answers:
    0
    Trophy Points:
    140
    #10
    I got another way to prevent spam...

    turn off the form. lol....

    I am just kidding. ;)

    ~Mike
     
    mike30, Oct 30, 2009 IP
  11. Bohra

    Bohra Prominent Member

    Messages:
    12,573
    Likes Received:
    537
    Best Answers:
    0
    Trophy Points:
    310
    #11
    lol that would just mean the war against spam has been lost
     
    Bohra, Oct 30, 2009 IP
  12. califmerchant

    califmerchant Active Member

    Messages:
    112
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    63
    #12
    the best option is to check for javascript, because only browsers run javascript and bots don't, solution:

    in your script include lines:

    <input type="hidden" name="javascriptcookie" id="javascriptcookie" value="false">
    <script language="JavaScript">
    if (document.cookie != ""){
    document.getElementById('javascriptcookie').value='true';
    }
    </script>

    then, once you process the form, check for $_POST[javascriptcookie]==true

    if its false, means it was a bot ...
     
    califmerchant, Oct 30, 2009 IP