Mailform basic spam protection...

Post custom hacks and enhancements for phpwcms here only. Maybe some of these things will be included in official release later.
bertalizer
Posts: 47
Joined: Sat 21. Feb 2004, 14:24
Location: Belgium

Mailform basic spam protection...

Post by bertalizer »

Hi
The mailform that gets created by phpwcms is great, but it shows the recipient address in the page. Spam bots can get the address.
I've changed the code a bit so the address get's "disguised".

in content.article.inc.php on 777, replace this

Code: Select all

$content["main"] .= "<input type=\"hidden\" name=\"recipient\" value=\"".$cform[2]."\">";
with

Code: Select all

$content["main"] .= "<input type=\"hidden\" name=\"recipient\" value=\"".str_replace("@", "OnFollowingServeR", $cform[2])."\">";
And in act_formmailer replace line 78

Code: Select all

$recipient = trim($_POST["recipient"]);
with

Code: Select all

$recipient = str_replace("OnFollowingServeR", "@", trim($_POST["recipient"]));
You can change OnFollowingServeR to whathever you want, but just make sure it wouldn't be something that could be a part of a real address.

So what this hack does:
The mailform gets the recipient address from a hidden field in the page, like this:

Code: Select all

<input type="hidden" name="recipient" value="bert@someserver.ext">
-> spambots recognise an email address
This "hack" changes this hidden field in

Code: Select all

<input type="hidden" name="recipient" value="bertOnFollowingServeRsomeserver.ext">
-> spambots don't recognise an email address

Hope this helps :)
B.
Last edited by bertalizer on Sun 29. Feb 2004, 15:41, edited 4 times in total.
Moozie
Posts: 164
Joined: Sat 8. Nov 2003, 00:21
Location: Netherlands

Post by Moozie »

You say I can change OnFollowingServeR to whatever I want. But do I have to change it into anything? Or can I leave it just as it is: OnFollowingServeR?

If it works it's OK, but I don't understand what it actually does, that "OnFollowingServeR"?
Guest

Post by Guest »

it is just a replacement for the @ in the email adress in the hidden field. Spambots are scanning through the internet for things that look like real email adresses and every email adress contains an @ so they scan for an @ as a first thing to find.

So if you replace the @ in the html code that is generatet on your page the spambots won't detect the string which is shown instead of the email adress as one.

clear enough ??

so what this script does is just the following:

normally there would be shown

me@mydomain.com

now the script in this case replaces the @ with OnFollowingServeR so the email adress will be shown as:

meOnFollowingServeRmydomain.com

which spambots don't detect as an email-adress

actually this hack is very useful and you can replace OnFollowingServeR with whatever you want as long as it could not be part of a real email-adress. so for example you could use:
asjdlahsdajsdj instead.

understand it better now ?
Guest

Re: Mailform basic spam protection...

Post by Guest »

hi there, that's a great enhancement. Well done,. Thanx.

But have a look. It's on line 777, not 77. :D

For those like me who searched and can't find.

regards
Guest

Re: Mailform basic spam protection...

Post by Guest »

hi there, that's a great enhancement. Well done,. Thanx.

But have a look. It's on line 777, not 77. :D

For those like me who searched and can't find.

regards
bertalizer
Posts: 47
Joined: Sat 21. Feb 2004, 14:24
Location: Belgium

Re: Mailform basic spam protection...

Post by bertalizer »

Anonymous wrote: But have a look. It's on line 777, not 77. :D
Oooops... I've corrected it.
thanks,
B.
cyrano
Posts: 1598
Joined: Sat 31. Jan 2004, 18:33
Location: Stuttgart
Contact:

Re: Mailform basic spam protection...

Post by cyrano »

no problem :-)

so i try it now.. :-)

regards
Gruß/ regards cyrano
--------------------------------------------------------
templates -> http://www.128.weitzelmedia.de
planepix -> http://www.planepix.de
XING -> https://www.xing.com/profile/Thomas_Weitzel3
cyrano
Posts: 1598
Joined: Sat 31. Jan 2004, 18:33
Location: Stuttgart
Contact:

on more question...

Post by cyrano »

does this works for all email adresses used in phpwcms or only in forms?

regards
Gruß/ regards cyrano
--------------------------------------------------------
templates -> http://www.128.weitzelmedia.de
planepix -> http://www.planepix.de
XING -> https://www.xing.com/profile/Thomas_Weitzel3
bertalizer
Posts: 47
Joined: Sat 21. Feb 2004, 14:24
Location: Belgium

Re: on more question...

Post by bertalizer »

cyrano wrote:does this works for all email adresses used in phpwcms or only in forms?
Only in forms... at the moment.

B.
cyrano
Posts: 1598
Joined: Sat 31. Jan 2004, 18:33
Location: Stuttgart
Contact:

Re: on more question...

Post by cyrano »

thanx - i thought this.

so also usefull - thanx for hack this out.

regards
Gruß/ regards cyrano
--------------------------------------------------------
templates -> http://www.128.weitzelmedia.de
planepix -> http://www.planepix.de
XING -> https://www.xing.com/profile/Thomas_Weitzel3
sporto
Posts: 160
Joined: Mon 10. Nov 2003, 18:01
Location: USA, Chicago

Post by sporto »

Great! Works like a charm. :D

Thanks
argos
Posts: 135
Joined: Mon 15. Mar 2004, 20:02

Post by argos »

Nice work, works great.
Regards,
Jurgen Nijhuis
http://www.argosmedia.nl
Jan212
Posts: 859
Joined: Wed 28. Jan 2004, 21:38
Location: Solingen
Contact:

Post by Jan212 »

good job...
Regards/ Grüsse/ Groetjes - JAN212
------------------------------------------------
null212 - Büro für Kommunikation und Design
------------------------------------------------
Lyrikfetzen des Tages
1. Ist der Quelltext auch valide fragt Herr Müller ganz perfide.
2. Wat is dat een lekker ding.
3. Wer Vision hat soll zum Arzt gehen.
------------------------------------------------
Nate
Posts: 42
Joined: Sun 11. Apr 2004, 18:26

Post by Nate »

Does anyone know where I can find this code to replace in RC4? It seems to have moved and I cannot locate it-- indeed my content.article.inc.php doesn't even go up to line 777 anymore!
To fathom hell or soar angelic...
User avatar
DeXXus
Posts: 2168
Joined: Fri 28. Nov 2003, 06:20
Location: USA - Florida

Post by DeXXus »

No idea if this change still works BUT:

Might this be it ?? (in "include/inc_front/content/cnt10.article.inc.php")

Code: Select all

$content["main"] .= "<input type=\"hidden\" name=\"recipient\" value=\"".$cform[2]."\" />";
Other change is now Line 99 of "act_formmailer.php"
Post Reply