share content

How to share a page in facebook

Today people use social networking site not only to make friend but also to share their contents.


Facebook offer a share dialog to share a link or page URL. people can share links on their timeline, in groups, or to their friends.

You can use following code to share link or page URL

<a href="" target="_blank"> Share on Facebook </a>

Use your desired link or page URL in place of ''. URL should be encoded.

It shares the content which is taken from og:image, og:title and og:description of the page.
People can like, comment and share on the content which is shared using this code.

For details please refer

You can customize title, image and description also.

Use following code to customize all content

<a title="Share it on Facebook" href="[url]=url&p[images][0]=img&p[title]=title&p[summary]=the description" target="_blank"> <img src="your/path/to/facebook-icon.png" alt="Share on Facebook" /> </a>

Images should follow aspect ratio ie. its size should be in ratio of 4:3 or 3:2, like this

Following example shows how to use it.




$title=urlencode("Share your link on facebook");

$summary="Share your link on facebook using sharer.php. You can choose your custom title, image and summary to share content on facebook timeline.";


<a title="Share it on Facebook" href="[url]=<?php echo $url ?>&p[images][0]=<?php echo $img ?>&p[title]=<?php echo $title ?>&p[summary]=<?php echo $summary ?>" target="_blank"> <img src="" alt="Share on Facebook" /> </a>

By rthrhr at 2016-08-02 23:10:30

We need your support to operate it properly. We have lots of ideas but less fund, so help us with your funding.


Thoughts of the day

A perfection of means, and confusion of aims, seems to be our main problem

Albert Einstein
Sell your product online

Do you want to sell products online with no extra cost?

Send your details, our executive will contact you




Tutorial On Request