Jump to content

Facebook Share link Dynamically and Thumbnails


ausgezeichnete

Recommended Posts

Hello

am using this code to share my content

but the problem is in the looping value

i can see the right value when i pass the mouse over the sharelink

but when i click on it its links me to the first value of the "product_id"

ex:it goes always to #1

http://localhost/mysite/coupons.php?...1&section=22#1

 

 

the second problem that it doesnt show the thumbnail

 

so plz any idea????????????????????????????

<?php do { ?>



<a name="fb_share" type="button_count" share_url="http://localhost/mysite/coupons.php?product_section_id=<?php echo $_GET['product_section_id'];?>&section=<?php echo $_GET['section'];?>#<?php echo $row_Recordset1['product_id']; ?>" href="http://www.facebook.com/sharer.php">Share</a>

                                <script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>

                        <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>

Firstly, you might want to move "<script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>" Out of the loop and put it in the <head>

 

share_url="http://localhost/mysite/coupons.php?product_section_id=<?php echo $_GET['product_section_id'];?>&section=<?php echo $_GET['section'];?>#<?php echo $row_Recordset1['product_id']; ?>"

 

changing that to

 

share_url="http://localhost/mysite/coupons.php?product_section_id=<?php echo $row_Recordset1['product_section_id'];?>&section=<?php echo $row_Recordset1['section'];?>#<?php echo $row_Recordset1['product_id']; ?>"

 

should fix it

 

thanks fred 4 ur answer

 

but what i noticed is that when i click on any one of the links and share it

the value remains the same after that

example:when i click on              http://localhost/mysite/coupons.php?product_section_id=30&section#408

it shares it without showing any thumbnail

 

and when i click on the next value #410

 

its gives me also the same link

example:when i click on http://localhost/mysite/coupons.php?product_section_id=30&section<b>#408<b>

 

although that i see the right link when the mouse is over the share link

 

so any clue plz????????????????

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.