SitePoint Sponsor

User Tag List

Results 1 to 9 of 9

Thread: Spamproof Email

  1. #1
    SitePoint Enthusiast
    Join Date
    Nov 2002
    Location
    Nottingham - UK
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Spamproof Email

    Saw the article and thought I should implement it as it shouldnt be too hard .. then found the other thread with the "encoded script email" (Link) .. prob is i had previously used an ahref link with onmouseover and onmouseout to mask the email address in the status bar (as I think it looks nicer) .. and I aint sure as to how id go about doing it now ..

    Thx in advance for any help

    (Yo All Btw )

    Crusader
    Last edited by Cru54d3r; Nov 2, 2002 at 17:18.

  2. #2
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I would avoid javascript to hide email addresses as people may have javascript disabled. Try doing this instead

    http://www.wbwip.com/wbw/emailencoder.html
    PHP Code:
    <a href="mailto:info@mywebsite.com">my email </a

  3. #3
    SitePoint Enthusiast
    Join Date
    Nov 2002
    Location
    Nottingham - UK
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If any web browser can decipher the encoded email surely it wont stop it being deciphered by an email spam bot?

    Crusader

  4. #4
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thats true, another simple way is to break up the email address

    PHP Code:
    <script type="text/javascript">
      var 
    p  "mailto:"//prefix
      
    var "part1";                                  //address
      
    var d  "@mywebsite.com";              //domain
    </script>

    <a href="#" onclick="document.location.href=p + a + d">my email</a> 

  5. #5
    SitePoint Enthusiast
    Join Date
    Nov 2002
    Location
    Nottingham - UK
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thx appreciated

    So ur nocturnal too hey?

    Crusader

  6. #6
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    nah, just on and off insomnia

  7. #7
    SitePoint Enthusiast
    Join Date
    Nov 2002
    Location
    Nottingham - UK
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why doesnt this work??

    Code:
    function email() { 
    var mail = "mailto:"; 
    var username = "bob"; 
    var at = "@"; 
    var hostname = "domain"; 
    var country = ".co.uk"; 
    document.write(mail + username + at + hostname + country); 
    }
    The above code placed in an external js .. and then on the html page:

    Code:
    <a href="javascript:email()">bob</a>
    Surely the function email should change to a mailto email addy that then gets linked inside the anchor??

    Thx

    Crusader

  8. #8
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    function email()

      var 
    mail "mailto:"
      var 
    username "bob"
      var 
    at "@"
      var 
    hostname "domain"
      var 
    country ".co.uk"
      
    document.location.href mail username at hostname country;

    Use that instead. his is because you cannot write to the document after it has been displayed, unless you use innerHTML etc.

  9. #9
    SitePoint Enthusiast
    Join Date
    Nov 2002
    Location
    Nottingham - UK
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thx it worked

    Crusader


Bookmarks

Posting Permissions

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