How to use Facebook Sharer in PHP

2019-07-25 15:33发布

Am I missing something? I use this simple code

<a name="fb_share" type="button" href="https://www.facebook.com/sharer.php?u=123.abc.comt=TEst">share on Facebook</a>

and the content that is being shared is blank? Thanks

标签: php facebook
4条回答
smile是对你的礼貌
2楼-- · 2019-07-25 15:39

Ah, Its simple, What ever page you want to share, Just put it after u= Any link after that will be shared on facebook, If the link page has og:meta-tags, og:image, og:title and og:decription, It will also be shared of that page making it interactive :)

查看更多
一纸荒年 Trace。
3楼-- · 2019-07-25 15:43

You're missing the ampersand ('&') in your url:

<a name="fb_share" type="button" href="https://www.facebook.com/sharer.php?u=123.abc.com&t=TEst">share on Facebook</a>
查看更多
SAY GOODBYE
4楼-- · 2019-07-25 15:55

Don't use the sharer, it has been deprecated and is no longer supported:

The Share button has been deprecated in favor of the Like button, and will no longer be supported.
Please use the Like button whenever possible to drive maximum traffic to your apps.

(http://developers.facebook.com/docs/share/)

What happened to the old Share button?

We deprecated the Share Button when we launched the Like button, because the Like button improves clickthrough rates by allowing users to connect with one click, and by allowing them to see which of their friends have already connected.

(http://developers.facebook.com/docs/reference/plugins/like/)

查看更多
Melony?
5楼-- · 2019-07-25 16:01

The Share button is no longer deprecated and has made a come back as share dialogue: https://developers.facebook.com/docs/reference/plugins/share-links/

On sites like buzzfeed.com their share buttons are still an important source of referral.

查看更多
登录 后发表回答