MORE RELATED

GROOMIX INFO
Blogs & Articles
MENU
. . .

programming

views : 352

Copy and paste code for facebook share button in your websites

To add facebook share button in your website, just copy and paste the following code in your webpage. it is run by javascript code which can be written in any of the file namely, PHP, .ASP etc.

Customize facebook button in bellow code

<div style="width:100%;height:50px"& gt;
<div class="share1">
<!---------------------Share facebook start------------------------>
<div data-href="<?php echo 'http://'.$_SERVER['HTTP_HOST '].$_SERVER['REQUEST_URI'];?& gt;" data-layout="button_count" data-mobile-iframe="true">&l t;a class="fb-xfbml-parse-ignore" target="_blank" href="https://www.facebook.com/share r/sharer.php?u=<?php echo 'http://'.$_SERVER['HTTP_HOST '].$_SERVER['REQUEST_URI'];?& gt;&src=sdkpreparse"><img src="<?php echo "http://".$_SERVER['HTTP_HO ST']."/sharing/";?>image s/fb_share.png" style="width:100px;height:30px;displ ay:block"/></a>
</div>
<!---------------------Share facebook link end------------------------>
</div>

This is your webpage address that you want to share on facebook

data-href="<?php echo 'http://'.$_SERVER['HTTP_HOST '].$_SERVER['REQUEST_URI'];?& amp; gt;"

example data-href="yoursite.xyz/groomix/inde x.php"

Button style can be easy change using css, here 

style="width:100px;height:30p x;displ ay:block" 

 

Facebook will get your webpage content through following code added just before title tag

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
    <meta property="og:image"         content="" />
    <meta property="og:site_name" &n bsp;    content="<?php echo $website_name;?>" />
    <meta property="og:url"           content="<?php echo 'http://'.$_SERVER['HTTP_HOST '].$_SERVER['REQUEST_URI'];?& gt;" />
    <meta property="og:type"          content="article" />
    <meta property="og:title"         content="<?php echo $page_title;?>" />
    <meta property="og:description"   content="<?php echo $page_desc;?>" />

    
    <!--<meta property="fb:page_id" content="34497296301" />--->
<!-- -----------------------Facebook sharing code start------------------------------------ ---->
<meta name="description" content="<?php echo $page_desc;?>"/>
<meta name="keywords" content="<?php echo $page_title.', '.$page_desc;?>" />
<title><?php echo $page_title;?></title>

Posted By :
Mr. Unique

2017-06-23/04:59:00

Share this Page

Comments...

More :programming

programming
Arduino UNO tachometer coding with variable resistor and DC motor speed control
views :182

p

programming
Here is the code to interface 2 serial devices with AVR
views :161

p

programming
Software Uart for AVR microcontroller tested on 1200 baud rate
views :611

p

programming
ATMEL STUDIO-While loop conditioning issues
views :229

p

programming
ATMEL STUDIO-While loop is not working using interrupt incremented conditioning
views :293

p

programming
Copy and paste code for facebook share button in your websites
views :352
programming
How to program atmel 8051 family microcontroller? (step by step)
views :244
programming
Embedded program code in C language for Digital Voltmeter for AVR microcontroller
views :315
programming
Assemby program code for Automatic Door Opening System (8051 family microcontroller)
views :228
programming
Very simple and accurate Seven Segment Display program Code in Embedded C language
views :260

p

programming
Highway vehicle speed detector or checker Embedded C language code in MikroC AVR Framework also applicable for 8051 Microcontroller
views :152

p

programming
Assembly program for accurate 1 second delay function
views :181
programming
What is Embedded system programming?
views :156

Latest Updates

kya transformer dc pe work kr skta h..?
views :0

kya transformer dc pe work kr skta h..?
views :136

kya transformer dc pe work kr skta h..?
views :0
Breaking News
Best internet Recharge Plans than jio..!
views :214
Engineering Project Ideas
Vehicle Theft Protection Using Gsm
views :191
Engineering Project Ideas
DTMF Controlled Robot or Mobile Controlled Robot
views :138
Engineering Project Ideas
Digital Clock With Home Appliances Control Using Microcontroller
views :100
Engineering Project Ideas
Cooking Monitor
views :195
Engineering Project Ideas
Boundary Security System(Wireless)
views :144
Engineering Project Ideas
Automatic Garage Parking System
views :138

---More To Do---

This pages is developed to give users a genuine web materials of all types throughout the world. Many articles, by experts are publishing here, every hours. You can publish your topics as well as you can comment on all posted topics and learn more. Many types of topics are published here like Technology based ( Electronics, Electricals, Mechanicals, civil engineering, computer science, programming and software development, Assemply language codings), Health like medicine, healthy diets, Homeopathy etc) and many types of latest news updates.


All content, design, and layout are Copyright © 2016 - Digital Photography Review All Rights Reserved. Reproduction in whole or part in any form or medium without specific written permission is prohibited.

MORE TO DO