Bluehost.com Web Hosting $6.95

How to check for multiple @'s

This is a discussion on How to check for multiple @'s within the PHP Language forums, part of the PHP Programming Forums category; We are trying to prevent spammers from mass mailing their list while using our contact us script. We have a ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 09-27-2006
affiliateian@gmail.com
 
Posts: n/a
Default How to check for multiple @'s

We are trying to prevent spammers from mass mailing their list while
using our contact us script. We have a few security measures in place
but would also like to add a "check for more than 1 @'s in the to:, cc:
and bcc: fields. Can anyone point us to some code or turotials for
doing this?

Thanks in advance.

Reply With Quote
  #2 (permalink)  
Old 09-27-2006
Ron Barnett
 
Posts: n/a
Default Re: How to check for multiple @'s

<affiliateian@gmail.com> wrote in message
news:1159368852.512889.252720@m7g2000cwm.googlegro ups.com...
> We are trying to prevent spammers from mass mailing their list while
> using our contact us script. We have a few security measures in place
> but would also like to add a "check for more than 1 @'s in the to:, cc:
> and bcc: fields. Can anyone point us to some code or turotials for
> doing this?
>
> Thanks in advance.


substr_count($CClist, '@')

will return the number of @ characters in $CClist

check out the PHP manual at PHP.net

Cheers

Ron


Reply With Quote
  #3 (permalink)  
Old 09-27-2006
affiliateian@gmail.com
 
Posts: n/a
Default Re: How to check for multiple @'s


Ron Barnett wrote:
> substr_count($CClist, '@')
>
> will return the number of @ characters in $CClist
>
> check out the PHP manual at PHP.net


THanks for the reply Ron.

Unfortunately, I am a newbie programmer and am having a tough time
making sense of the manual at PHP.net.

I can see hwo checking for the # of @'s will lead to a few statements
like if > 1 then blah. But am still lost as to actually coding this
into our current sciprt. Any more hints / tutorials / help for a newbie
in php?

Reply With Quote
  #4 (permalink)  
Old 09-27-2006
Ron Barnett
 
Posts: n/a
Default Re: How to check for multiple @'s

<affiliateian@gmail.com> wrote in message
news:1159378729.124628.218680@h48g2000cwc.googlegr oups.com...
>
> Ron Barnett wrote:
>> substr_count($CClist, '@')
>>
>> will return the number of @ characters in $CClist
>>
>> check out the PHP manual at PHP.net

>
> THanks for the reply Ron.
>
> Unfortunately, I am a newbie programmer and am having a tough time
> making sense of the manual at PHP.net.
>
> I can see hwo checking for the # of @'s will lead to a few statements
> like if > 1 then blah. But am still lost as to actually coding this
> into our current sciprt. Any more hints / tutorials / help for a newbie
> in php?


all you need to do is check to see if there is more than your allowed number
of CCs in the list

I'm assuming you have the headers available in a string somewhere, if not
the task will be difficult to explain.

If you send me a mail with details of what you have and what you want to do
I'll have a look at it and try to get you on the right track.

Just remove the REMOVE bits from my email address.

There are a number of excellent PHP books in the market, I can recommend the
PHP developers cookbook published by SAMS (Angus Hughes / Andrei Zmievski)
although not a PHP primer it does give a good easy to follow set of code
examples.

Cheers

Ron


Reply With Quote
  #5 (permalink)  
Old 09-28-2006
ctclibby
 
Posts: n/a
Default Re: How to check for multiple @'s


affiliateian@gmail.com wrote:
> We are trying to prevent spammers from mass mailing their list while
> using our contact us script. We have a few security measures in place
> but would also like to add a "check for more than 1 @'s in the to:, cc:
> and bcc: fields. Can anyone point us to some code or turotials for
> doing this?
>
> Thanks in advance.


Hi

Maybe this is not needed for what you are trying to do ... but ...
Don't put in fields that have eMail return addresses in them at all.
This way, spammers can not fill in the field(s) with bogus email addys.
If you already have a contact script maybe it would be better to
modify it so that the choices available to the surfer are 'script
aliases' instead of real email addys. Make sure that the script
aliases used here are NOT email aliases in your email server. For
instance, we use:

Administrator
AP/AR
Manager
Reception
Technicial
....
the list can go on. To which each can point to a real email addy.
Some can be different if you wish, or all can point to the same real
email addy.

I looked at the 'picture based' form where you must enter some sort of
letters and number combination to submit but decided on the form based
above. In either event, the surfer does not get your email addy until
YOU reply to their question or comment.

Note that I started doing this about 4 years ago and had problems with
my users as they believed it would be harder to contact using this sort
of form. Since then, all have come on to my side of the fence and see
the benefit of less spam. Surfer sees that something was sent as my
server replies in a web-widget that it indeed was sent.

todh

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 12:28 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0