Perl: the Markov chain saw | |
PerlMonks |
Re: CSS for printing and tell-a-friend scriptsby gaal (Parson) |
on Dec 07, 2004 at 15:08 UTC ( [id://412917]=note: print w/replies, xml ) | Need Help?? |
Tell-a-friend can be dangerous: if a spammer finds your form, they can use *your* computer resources to send out lots of spam -- which will be traced back to you. Only allow authenticated users to use this feature, and make some provision to limit the amount of messages each user is allowed to send. You have been warned!
As for how to send the actual message, there are plenty of mail modules on CPAN. I think MIME::Lite can do what you want with a minimum of fuss. Adding a link to your existing pages depends on how your site is designed. If you're using any kind of templating system, it's easy -- add it once to the appropriate template. If you aren't -- then you should :-) but you might, in a pinch, do a quick search and replace for <BODY> (or some other location that exists in your pages), and put <BODY><A HREF="your page">tell a friend</a>. There are perl one-liners that can do that for you. Printer-friendly pages? The answer again depends on how your site is designed, but if the data is coming from a database and then rendered by a template, just make a "printer" version of the template that doesn't include the printer-unfriendly elements :) Update: eieio's suggestion re: CSS is a very good one, too.
In Section
Seekers of Perl Wisdom
|
|