This topic is locked

Facebook Like Button for View Pages Not redirecting

5/12/2012 1:35:17 PM
PHPRunner General questions
milsimcorps author

I am trying to add a Facebook Like and Send Button to different views. I am using the XFBML script. According to Facebook once someone likes your page it will automatically retrieve the link of the page that was liked and post it to Facebook. This not the case. The Like that is posted on Facebook is www.milsimleague.info/ instead of the page that was liked e.g. http://www.milsimleague.info/leaguedatabase2/Countries_view.php?editid1=7. The Database is Password protected but has the ability to view the pages as a Guest. Does anyone have an idea on how to get it to work properly?

Sergey Kornilov admin 5/13/2012

If I go to the page like this one http://www.milsimleague.info/leaguedatabase2/Paintball_Parks_view.php?editid1=88 I can see the following HTML code generated by Facebook button:

<IFRAME style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; WIDTH: 90px; HEIGHT: 21px; OVERFLOW: hidden; BORDER-TOP: medium none; BORDER-RIGHT: medium none"

src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.milsimleague.info%2Fleaguedatabase2%2FPaintball_Parks_list.php&amp;send=false&amp;layout=button_count&amp;width=90&amp;show_faces=true&amp;action=like&amp;colorscheme=light&amp;font&amp;height=21&amp;appId=404468849585549";

frameBorder=0 allowTransparency

scrolling=no></IFRAME>


Obviously it points to the list page (Paintball_Parks_list.php). I guess you need to make changes to your Facebook code so it point to the current page instead.

milsimcorps author 5/13/2012



If I go to the page like this one www.milsimleague.info/leaguedatabase2/Paintball_Parks_view.php?editid1=88'>http://www.milsimleague.info/leaguedatabase2/Paintball_Parks_view.php?editid1=88 I can see the following HTML code generated by Facebook button:

<IFRAME style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; WIDTH: 90px; HEIGHT: 21px; OVERFLOW: hidden; BORDER-TOP: medium none; BORDER-RIGHT: medium none"

src="//www.milsimleague.info%2Fleaguedatabase2%2FPaintball_Parks_list.php&amp;send=false&amp;layout=button_count&amp;width=90&amp;show_faces=true&amp;action=like&amp;colorscheme=light&amp;font&amp;height=21&amp;appId=404468849585549"'>www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.milsimleague.info%2Fleaguedatabase2%2FPaintball_Parks_list.php&amp;send=false&amp;layout=button_count&amp;width=90&amp;show_faces=true&amp;action=like&amp;colorscheme=light&amp;font&amp;height=21&amp;appId=404468849585549"

frameBorder=0 allowTransparency

scrolling=no></IFRAME>


Obviously it points to the list page (Paintball_Parks_list.php). I guess you need to make changes to your Facebook code so it point to the current page instead.


Do you mean include the url of the specific page in the Facebook set up (URL TO LIKE field)? If this is so than that would be almost impossible for there are too many records and new records are added constantly. I have tried leaving the URL TO LIKE field empty in Facebook Like App and it will only post the link www.milsimleague.info on the Facebook wall or message
Is there a specific url that I should paste that would go directly to any page that is liked? See image below

Sergey Kornilov admin 5/15/2012

You need to search Facebook documentation for a sample code that allows to like the current page, no matter what URL is. That's the code you need to add there.