Ex1t Posted August 9, 2015 Share Posted August 9, 2015 This is my code for facebook like and share <img src='<?php echo $path; ?>' height="500" width='500' alt='<?php echo $imgname; ?>' title='<div class="fb-like" data-href="http://mysite.com/<?php echo $path; ?>" data-layout="standard" data-action="like" data-show-faces="true" data-share="true"></div>'"></iframe> Now $path is location to image, $imgname is name of image When I look image for first time I can see like and share button, but when i do it again, i cant see like and share button.. Why? Quote Link to comment https://forums.phpfreaks.com/topic/297698-facebook-like-and-share/ Share on other sites More sharing options...
abrahamgarcia27 Posted August 9, 2015 Share Posted August 9, 2015 maybe it has to do something with your $path variable. Can we see that? Quote Link to comment https://forums.phpfreaks.com/topic/297698-facebook-like-and-share/#findComment-1518365 Share on other sites More sharing options...
Ex1t Posted August 10, 2015 Author Share Posted August 10, 2015 <?php .... $sql="SELECT * FROM `images` ORDER BY `id` DESC LIMIT $start,$end"; $rdata=mysqli_query($conn, $sql); while($res=mysqli_fetch_array($rdata)) { $imgname=$res['image']; $path = 'img/'.$imgname; ?> <img src='<?php echo $path; ?>' height="500" width='500' alt='<?php echo $imgname; ?>' title='<div class="fb-like" data-href="http://site.com/<?php echo $path; ?>" data-layout="standard" data-action="like" data-show-faces="true" data-share="true"></div>'> <?php } ?> Quote Link to comment https://forums.phpfreaks.com/topic/297698-facebook-like-and-share/#findComment-1518381 Share on other sites More sharing options...
maxxd Posted August 10, 2015 Share Posted August 10, 2015 Couple things here. First and foremost, print the value of $path to screen - that way you can see (and show us) exactly what the variable $path contains. Secondly, why are you trying to put a div in the title attribute of an image? Quote Link to comment https://forums.phpfreaks.com/topic/297698-facebook-like-and-share/#findComment-1518410 Share on other sites More sharing options...
Ex1t Posted August 10, 2015 Author Share Posted August 10, 2015 (edited) Because im using fancybox for zoomWhen someone click on image, image zooms and title attribute is description or in my way like and share buttons Edited August 10, 2015 by Ex1t Quote Link to comment https://forums.phpfreaks.com/topic/297698-facebook-like-and-share/#findComment-1518414 Share on other sites More sharing options...
RobertVecy Posted October 14, 2015 Share Posted October 14, 2015 I would have only been following the instructions for the facebook like button.But in hindsight, I would concur. Quote Link to comment https://forums.phpfreaks.com/topic/297698-facebook-like-and-share/#findComment-1523279 Share on other sites More sharing options...
satyapriya Posted October 23, 2015 Share Posted October 23, 2015 Its because of the file paths...check patiently..you will get the solution. Quote Link to comment https://forums.phpfreaks.com/topic/297698-facebook-like-and-share/#findComment-1524133 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.