How-To PHP

How to make a Social Sharer in PHP

Nowadays, social media sharing is required for any web-related projects. Some advantages of social media sharing are :

  • Reduced in marketing costs.
  • Increased in sales.
  • Increased traffic to your website.
  • Improved ranking on search engines.

There are so many free and easy-to-implement services out there. But all those social sharing plugins are used a lot of JavaScript which is increases page load time and it results in poor user experience. So, if you want to customize the social sharing button as per your project theme and load the page faster, then it will be a good idea to use social share buttons with custom links and custom CSS for your sharer buttons.


<link rel="stylesheet" href="">
<div class="socialShare">
<a href="<?php echo $_SERVER[HTTP_HOST] . $_SERVER[REQUEST_URI]; ?>" target="_blank" class="share-btn google-plus">
<i class="fa fa-google-plus"></i></a>
><a href="<?php echo $_SERVER[HTTP_HOST] . $_SERVER[REQUEST_URI];  ?> " target="_blank" class="share-btn facebook">
<i class="fa fa-facebook"></i></a>
<a href="<?php echo $_SERVER[HTTP_HOST] . $_SERVER[REQUEST_URI]; ?>" target="_blank" class="share-btn linkedin">
<i class="fa fa-linkedin" style="margin-left:5px;"></i></a>


About the author


A coder who is trying to solve some problems via "Procoders", Software Engineer By Profession, WEB Enthusiast, Hobby Blogger. I love to share Tech Ideas and like to learn and explore new things and Technologies.

Add Comment

Click here to post a comment