Click here to Skip to main content
15,883,623 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I've created one web page in that I need to share some contents to the users via social media for that I've tried,

HTML
<ul class='share-story'>
<?php $site_url = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; 

echo "<li><a class='tips' data-title='Facebook' href='http://www.facebook.com/sharer.php?u=  ".$site_url."&title=Welcome to our Blog' rel='nofollow' target='_blank'><img src='https://lh4.googleusercontent.com/-ZLBXhszmKcM/UhRopVveCXI/AAAAAAAACgk/A4UMB2mIVpc/s33/fb.jpg'/></a></li>";


echo "<li><a class='tips' data-title='Linkedin' href='https://www.linkedin.com/cws/share?url=".$site_url." '><img src='https://lh6.googleusercontent.com/-ffL-1GnpCbQ/UhRoqObh1DI/AAAAAAAACg4/DPcWbZiXIPM/s33/linkedin.jpg'/></a></li>";


echo "<li><a class='tips' data-title='Twitter'                 href='http://twitter.com/share?url=".$site_url."' rel='nofollow' target='_blank'><img src='https://lh6.googleusercontent.com/-LWZCI166jr4/UhRorVB4MdI/AAAAAAAAChI/V3ir2xRth7U/s33/twitter.jpg'/></a></li>";


echo "<li><a class='tips' data-title='Google+'        href='https://plus.google.com/u/0/share?url=".$site_url."' rel='nofollow' target='_blank'><img src='https://lh6.googleusercontent.com/-GnP5yhTBMQU/UhRop_RqX7I/AAAAAAAACg8/z1oV5uQeGdk/s33/gplus.jpg'/></a></li>";
?>

</ul>


This code run correctly but what is my problem is, it will share only the link of the specified page to the user and does not share any images and the content.


Help me to do this one.


Thanks in advance,
Sanjita
Posted
Updated 29-Jan-15 1:29am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900