Dynamic Links in the LIKE button

Discussion in 'Facebook API' started by mikemdg, Jun 27, 2011.

  1. #1
    I'm trying to add a LIKE button using the facebook developers form here - http://developers.facebook.com/docs/reference/plugins/like/

    I'd like the button to work for every page though and I'm not sure how to do it (dynamic pages). So a url for example would be www.mysite.com/page.php?id=2

    So in the "URL to Like" box I put http://www.mysite.com/page.php?id=<?php echo $id; ?> and made a variable to grabe the page id, but when I make the button it doesn't return the specific page, it just goes to page.php with no id#

    Any ideas?
     
    mikemdg, Jun 27, 2011 IP
  2. mrdo

    mrdo Well-Known Member

    Messages:
    1,552
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    138
    #2
    add:
    &href=http://www.mysite.com/page.php?id=<?php echo $id; ?>
    to your code
     
    mrdo, Jun 27, 2011 IP
  3. mikemdg

    mikemdg Member

    Messages:
    68
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #3
    Thanks, all sorted now!
     
    mikemdg, Jun 27, 2011 IP