soycharliente Posted October 22, 2006 Share Posted October 22, 2006 This is my very first post. I just joined this forum today. I've heard a lot about it so don't let me down!I am very new to PHP. In fact, I just acquired my own hosting account and domain name about 2 weeks ago. I'm struggling through teaching myself and it's going very slow.And now my question:Is there a best practice was for obfuscating e-mail addresses in PHP or would something as simple as using ASCII be good enough to confuse spam crawlers? Quote Link to comment Share on other sites More sharing options...
Orio Posted October 22, 2006 Share Posted October 22, 2006 You mean create random (unreal) email adresses?Orio. Quote Link to comment Share on other sites More sharing options...
gmwebs Posted October 22, 2006 Share Posted October 22, 2006 The way I see it, there are 2 ways to do this. One is to use a contact form where your email address stays server-side, and the other is to use character entities. The safest imho is to use a contact form, that way your email address is never presented.Character entities - [url=http://www.ohlone.cc.ca.us/org/webcenter/emailencoding.html]http://www.ohlone.cc.ca.us/org/webcenter/emailencoding.html[/url] Quote Link to comment Share on other sites More sharing options...
soycharliente Posted October 22, 2006 Author Share Posted October 22, 2006 [quote author=gmwebs link=topic=112368.msg455986#msg455986 date=1161552485]The safest imho is to use a contact form, that way your email address is never presented.[/quote]WOuld that mean like creating a database to store my contact info and whenever I wanted to present it I would have to access the database, run a query for a certain row of data, and echo the result?That's probably wrong. Because it would just display the text on the page and you could still grab it. Quote Link to comment Share on other sites More sharing options...
EngineeringGuy Posted October 22, 2006 Share Posted October 22, 2006 I think he means something like this:http://www.sms-lp.com/inforeq.phpThat is something I made for my office. . Basically the script is sending the email and nobody (except for you) ever knows what address it goes to. (Please don't spam it too much as my secratary might get a little pissed =-D ) Quote Link to comment Share on other sites More sharing options...
gmwebs Posted October 22, 2006 Share Posted October 22, 2006 Yeah that is one way to do it which will send the form to one or more email addresses which you provide in the mail script. Alternatively, you could also provide a drop down list of recipients, and then send the mail to the relevant recipient based on the value in the POST data to the mail script.[code]<?php$recipient = $_POST['recipient_field'];switch ($recipient) { default: //send email to webmaster break; case "person1": //send email to person1@somewhere.com break; case "person2": //send email to person2@somewhereelse.com break;}?>[/code] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.