Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

conceptual question

Status
Not open for further replies.

Tracy3e

Technical User
Jun 23, 2001
54
CA
I know nothing about Javascript - am wondering if this language or any other would make the following concept possible:

Spammers love our website because we display our employees email addresses on our website (company policy).

To prevent the harvesting of email addresses, we would like to have an envelope icon beside the employee's name and then when someone clicks on the envelope a query is sent to the database, looks for the associated email address (mailto:) and then opens the user's email client with the mailto address?

If there is a way I will pass the info along to our programmer. Thank you.
 
This is how we handle email address hiding in our web design. Just put this on the page where you want the email addresses to display:

<script language=&quot;javacript&quot;>

var mailserver='@yourdomain.com';

var empaddress=new Array('BillJenkins','FredMurphy');
var empname=new Array('Bill Jenkins','Fred Murphy');

for (var mi=0;mi<employees.length;mi++)
{
document.write(<img src=&quot;mailicon.gif&quot;>);
document.write('a href=mailto:');
document.write(empaddress[mi] + mailserver +'&quot;>')
document.write(empname[mi] + '</a><br>\n');
}

</script>



 

you could also store the array of addresses in an external .js file, and call it with the <script language=javascript src='external.js'>...

that way, they are further out of reach...at least some time and effort will go into the theft of them.

but i wonder if there is another way...do you have to call the users' email program? or rather can you create an email page and have a drop down with employee names only; then when you hit send, you call a cgi script that mails it to one or as many employees as indicated, taking the user to a 'thank you, you message has been sent' page. it avoids the email stealing issue and expedites the contact process...and sharpens things up...in my opinion.

otherwise, store the addresses in variables off screen and have functions for each employee name call that variable, and the mailto: can have the value added to it.

**

<script>

function mailme(n) {

switch(n) {
case 'bob' : addr = 'bjones@company.com';break;
case 'sue' : addr = 'sanders@company.com';break;
}

location.href=&quot;mailto:&quot; + addr

}

</script>

<br><br>

<input type=button value='email bob jones' onclick=&quot;mailme('bob')&quot;;>
<input type=button value='email sue anderson' onclick=&quot;mailme('sue')&quot;;>

**



- spewn

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top