homepage Welcome to WebmasterWorld Guest from 54.237.78.165
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
How Do You Provide Visitors the Option to Share/E-mail Your Content?
Tehuti

5+ Year Member



 
Msg#: 3750982 posted 5:55 am on Sep 24, 2008 (gmt 0)

Next to the content on many web sites it is now commonplace to find options to share the content on bookmark sites or e-mail the content to friends. For example, such options occur beneath YouTube videos. I want to do the same on my web site. The problem is, I haven't the slightest clue as to how it's done.

Can someone please give me a brief overview of how to do it, just to kickstart my learning?

 

phranque

WebmasterWorld Administrator phranque us a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



 
Msg#: 3750982 posted 6:52 am on Sep 24, 2008 (gmt 0)

in my experience these links typically send a form email along the lines of "a friend of yours thought you might be interested in browsing http://www.example.com/some-page-of-awesome-content".

Tehuti

5+ Year Member



 
Msg#: 3750982 posted 6:22 pm on Sep 24, 2008 (gmt 0)

Thanks for the response, Phranque!

I understand that. What I meant was, what are the ways in which such a thing can be done?

For example, are there scripts which let you do it?

Here's what I want . . .

1) A visitor clicks the "E-mail" button
2) An e-mail form pops up, pre-populated with the content
3) All the visitor has to do is enter the person's e-mail, before clicking "Send"

Or . . .

1) A visitor clicks the "Share" link
2) A box appears with the logos of all the popular bookmarking sites
3) All the visitor has to do is choose a site, which is then pre-populated with the content

cosmoyoda

5+ Year Member



 
Msg#: 3750982 posted 6:32 pm on Sep 29, 2008 (gmt 0)

You might want to use the mail() function [ca3.php.net] to do this.

What you can do is use some good Javascript code to make the user experience more... enjoyable:

1. Create a link that when clicked will popup a new window. Something like <a href="#" onClick="openWindow()">Send To A Friend</a>. Use the function "window.open(url,'name','height=200,width=150');" (with your own parameters) in your openWindow() function to open the window.
2. That popup window will have a form. Use PHP to process the form if the form has been submitted. When submitted, process the form and use the PHP function mail() to send a message containing the link to your article to the email specified in the form.

Good luck. You shouldn't have problems doing this. It is pretty straight forward.

grallis

5+ Year Member



 
Msg#: 3750982 posted 11:04 pm on Sep 29, 2008 (gmt 0)

Hi Tehuti -

As for bookmarking, I recall that Digg had a few methods of adding a link on your site that would add the link to Digg. I believe one was a Digg button, but there was a URL you could copy to use a custom version of the button where you could add your own image or link.

As for mailing, I personally when possible use a free library called 'Swift Mailer'. It's free, fully featured and a lot quicker than the mail() function.

Be warned, it doesnt work on all hosts like GoDaddy for example, but the mail() function isn't always enabled either(Some hosts disable the use of it because it's very slow)

Swift Mailer makes it much easier to send html email, and large batches of email if need be. I suggest you Google "PHP swift mailer'

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved