Web Hosting Forum | Lunarpages


*
Welcome, Guest. Please login or register.
Did you miss your activation email?



Login with username, password and session length
May 25, 2012, 07:26:08 AM

Pages: [1]   Go Down
  Print  
Author Topic: How to add Email this link Text/Icon to website?  (Read 585 times)
auweout
Pong! (the videogame) Master
*****
Offline Offline

Posts: 28


« on: November 17, 2011, 02:24:08 AM »

I want to be able to add either Email This Page text or an icon that would appear on the bottom of a product page on my website.
Is there specific html that would need to be used? It would have to copy the URL and add something like a text box to enter an email address and of course have protection from spambots. How would I go about adding something such as this?
Logged
MrPhil
Senior Moderator
Berserker Poster
*****
Online Online

Posts: 5219



« Reply #1 on: November 17, 2011, 08:30:50 AM »

I would implement it as a link (with text or graphics button) to go to a new page (or the current page with a URL Query String, if you're processing that in PHP or the like). Perhaps it could pop up a JavaScript dialog to ask for the email address, and include that in the URL (encoded and checked URL-safe). You have to watch out for 1) possible injections of bogus email addresses that do other (bad) things when put on the URL Query String, and 2) spamming by bad guys (at a minimum, limit to one address).

Whether you get the email address on the original page, or serve a new page to ask for the address, you then need to decide what content to put in the page. Is it going to be pure text, or a printer-friendly page with minimal graphics, using HTML, or something else? You could best use your original text source (for building the original Web page) as the source for the email. If a page is formatted with CSS in "printer friendly" layout, I don't know if there's a way to capture it at the browser and email it directly (which may be vulnerable to bot spamming anyway).

You should probably keep track of how often a given IP address attempts to email any page, and enforce a time delay, to minimize use of this for spamming by bots.
Logged

Visit My Site

E-mail Me
  
-= From the ashes shall rise a sooty tern =-
Pages: [1]   Go Up
  Print  
 
Jump to: