/    Sign up×
Community /Pin to ProfileBookmark

Limit sends.

Hello, I hope you can help please.

We have a lot of forms on our site, and we use a PHP mailer which validates the input, assigns unique ID’s and ultimately should everything pass validation, a mail is sent using PHP’s mail() function.

Is there a way however we can limit how many submissions are sent from each IP? As there is more than one mailer script I wondered if there was some check we could do to see if an IP has already used the mail() function say twice, and if so alert them a message saying to try later…

Is that possible?

Thanks.

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@MstrBobOct 19.2004 — Create a database table, store IP, number of times used the mail function, and the time&date of last using the function. Then, simple if/else
Copy linkTweet thisAlerts:
@DanUKauthorOct 20.2004 — Hi there.

Thank you for your post.

Unfortunately we cannot use a database for it.

Could it be achieved with flatfile?

The only concern I have with that is the size that file could get to.

Hmmm... hard one. ?

Thanks.
Copy linkTweet thisAlerts:
@MstrBobOct 20.2004 — Hmm... flatfile, eh? I suppose you could create it flatfile. You could use an xml file, and use it as a sort of pseudo-database. You could have an <ip> tag, <date> tag and all, no?
×

Success!

Help @DanUK spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.15,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...