Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 585795
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:02:23+00:00 2026-05-13T15:02:23+00:00

I’m actually working on a PHP project that will feature a user system (Login,Register,Send

  • 0

I’m actually working on a PHP project that will feature a user system (Login,Register,Send lost password to email,..) and I think that this may be very vulnerable to Brute-Force attacks and/or Spam (Send a password to someone’s email like 1000 times, etc. use your fantasy)
.

  • Do today’s webservers (Apache, IIS) have some sort of built-in defense against Brute-Force?
  • What would be the best way to implement an Anti-Spam/Flood system, if I e.g.: want a page not be able to be called more than two times a minute, however another page may be called up to 100 times a minute or so.

    • I would definitely have to store IP adresses, the time when they last visited a page and the number of visits somewhere – but would it be efficient enough storing it in a text-file/database (MySQL)

    • Should I use captchas for things like registering/recovering lost passwords?

    • Are “text” captchas viable? (Something like “What is 5 plus 9 minus 2? “)

    • The page won’t be used by that many users (100-200), do I actually have to implement all these things?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T15:02:24+00:00Added an answer on May 13, 2026 at 3:02 pm

    Regarding CAPTCHAs: I would recommend against using CAPTCHAs unless you really need it. Why?

    1. it’s ugly.
    2. it’s annoying for your users. You shouldn’t make them jump through hoops to use your site.

    There are some alternatives which are very simple, can be very effective and are entirely transparent to (almost all) users.

    1. Honeypot fields: add a field to your forms with a common name like “website”. Beside it, add a label saying something to the effect of “don’t write in this box”. Using Javascript hide the input and label. When you receive a form submission, if there’s anything in the field, reject the input.

      Users with JS won’t see it and will be fine. Users without JS will just have to follow the simple instruction. Spambots will fall for it and reveal themselves.

    2. Automatic faux-CAPTCHA: This is similar to the above. Add an input field with a label saying “Write ‘Alex'” (for example). Using Javascript (and knowing that most automated spam bots won’t be running JS), hide the field and populate it with ‘Alex’. If the submitted form doesn’t have the magic word there, then ignore it.

      Users with JS won’t see it and will be fine. Users without JS will just have to follow the simple instruction. Spambots won’t know what to do and you can ignore their input.

    This will safeguard you from 99.9% of automated spam bots. What it won’t do, even in the slightest, is safeguard you against a targeted attack. Someone could customise their bot to avoid the honeypot or always fill in the correct value.


    Regarding Brute Force blocking: A server-side solution is the only viable way to do this obviously. For one of my current projects, I implemented a brute force protection system very similar to what you describe. It was based on this Brute Force Protection plugin for CakePHP.

    The algorithm is fairly simple, but a little confusing initially.

    1. User requests some action (reset password, for example)
    2. Run: DELETE * FROM brute_force WHERE expires < NOW()
    3. Run:

      SELECT COUNT(*) FROM brute_force 
      WHERE action = 'passwordReset'
      AND ip = <their ip address>
      
    4. If the count is greater than X then tell them to wait a while.
    5. Otherwise, run:

      INSERT INTO brute_force (ip, action, expires)
      VALUES (<their ip address>, 'passwordReset', NOW() + Y minutes)
      
    6. Continue with the reset password function.

    This will allow users to only try resetting a password X times in Y minutes. Tweak these values as you see fit. Perhaps 3 resets in 5 minutes? Additionally, you could have different values for each action: for some things (eg: generate a PDF), you might want to restrict it to 10 in 10 minutes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 371k
  • Answers 371k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer In fact setting a breakpoint in eclipse is very easy.… May 14, 2026 at 6:56 pm
  • Editorial Team
    Editorial Team added an answer If you have the time parsed into variables then you… May 14, 2026 at 6:56 pm
  • Editorial Team
    Editorial Team added an answer It seems that you have two problems: aggregating multiple RSS… May 14, 2026 at 6:56 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.