Results 1 to 6 of 6
  1. #1
    New Lounger
    Join Date
    Jan 2002
    Location
    Tonsberg Norway
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Using a contact sheet to hide email addresses

    For obvious reasons, it has become highly desirable to avoid email addresses on a web page. Are there anyone who have a link to a simple solution of something like:
    - Clickable namelist that after click:
    - Brings up a contact/message form for the clicked name (with fields like Subject, date, from email etc)
    - On submit, performs one of these:
    -1-saves the field to a database file like Access/MSDE/SQL (or a file); which require some script to trigger emails from that database via SMTP service on the server. OR:
    -2- On submit reads the corresponding emailaddress from a database/textfile, uses server SMTP to generate and in fact send that mail

  2. #2
    Plutonium Lounger Leif's Avatar
    Join Date
    Dec 2000
    Location
    U.K.
    Posts
    14,010
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Using a contact sheet to hide email addresses

    I assume your desire to hide email addresses is to prevent spiders from picking them up?

    Try this little script - it simply prints the word 'e-mail' which, when clicked on, opens up a pre-addressed email:<pre><SCRIPT LANGUAGE="JavaScript">
    user = "username";
    site = "domain.com";
    document.write('<a href="mailto:' + user + '@' + site + '">');
    document.write("e-mail");
    </SCRIPT></pre>


  3. #3
    New Lounger
    Join Date
    Jan 2002
    Location
    Tonsberg Norway
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Using a contact sheet to hide email addresses

    Your assumption is correct. And your solution is nice and surprisingly simple (I'm no good at Java).
    I tried putting the script into a webpage Body, a bit modified to include 2 users, like this:

    <SCRIPT LANGUAGE="JavaScript">
    firstname="Brumba"
    lastname="Grumba"
    user = firstname + " " + lastname
    usermail=firstname + "."+ lastname
    site = "Scanmar.no";
    document.write('<a href="mailto:' + usermail + '@' + site + '">');
    document.write(user);
    </SCRIPT>
    <SCRIPT LANGUAGE="JavaScript">
    firstname="Limba"
    lastname="Caramba"
    user = firstname + " " + lastname
    usermail=firstname + "."+ lastname
    site = "Scanmar.no";
    document.write('<a href="mailto:' + usermail + '@' + site + '">');
    document.write(user);
    </SCRIPT>

    A couple of questions:
    - How do I put in the Anchor endtag (/a) ?
    - If I made a textfile with a lot of names, us there any chance to get some advice on how to loop those programmatically onto the webpage?

    (A textfile would be something like:
    firstname lastname
    with just a space between)

  4. #4
    Plutonium Lounger Leif's Avatar
    Join Date
    Dec 2000
    Location
    U.K.
    Posts
    14,010
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Using a contact sheet to hide email addresses

    Are you looking for a once-only solution (to quickly enter all the addresses), or a means to easily change what is published in the future, simply by changing the contents of the text file?

  5. #5
    New Lounger
    Join Date
    Jan 2002
    Location
    Tonsberg Norway
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Using a contact sheet to hide email addresses

    I was thinking of the dynamic kind, which was the reason for thinking of using some kind of loop to list all the names that are listed in the updated text file.

  6. #6
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Using a contact sheet to hide email addresses

    On our web site I define this function:

    function email(uname) {
    document.write("<a href="mailto");
    document.write(":" + uname + "@");
    document.write("carr-ferrell"+"."+"com"]<font face="Arial" size="2">" + uname + "@");
    document.write("carr-ferrell"+"."+"com</font></a>");
    }

    Then, where I want an e-mail address, I just put this:

    <script language="JavaScript">email("username");</script>

    Scales like crazy. Looks like this: <A target="_blank" HREF=http://www.carr-ferrell.com/people/alphabetical_index.html>http://www.carr-ferrell.com/people/a...cal_index.html</A>

    Now your syntax would be different, but you can do all the heavy lifting in the function and keep your page code simple.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •