简体   繁体   English

使用facebook sharer.php与多个url变量共享一个url

[英]share an url with multiple url variables using facebook sharer.php

I have an url i would like users to share using facebook sharer.php 我有一个网址,我希望用户使用facebook sharer.php分享

http://www.facebook.com/sharer.php?s=100&p[title]=$title>&p[summary]=$descp&p[images][0]=$image&p[url]=$url) 

where $ur l is the url i would like to share. 其中$ur l是我想分享的网址。 the structure of my url is as follows 我的网址结构如下

http://mydomain.com/index.php?variable1=value1&variable2=value2 http://mydomain.com/index.php?variable1=value1&variable2=value2

...apparently, facebook seems to scrap out the rest of the url after encountering the 1st '&' on my url. ...显然,facebook在遇到我的网址上的第一个“&”后似乎废弃了网址的其余部分。

Decoding the url din't help either. 解密网址也没有帮助。 Is there a way i can pass the full url plus the variables in it to be shared with the rest of the details? 有没有办法可以传递完整的url加上其中的变量与其他细节共享?

Send your entire url encoded. 发送您的整个网址编码。 So & of your url will be replaced with %26 . 因此, &您的网址将被替换为%26 I found it. 我找到了。 Thanks for your question. 谢谢你的提问。

Try changing your & to & 尝试将您的&更改为& . This worked for me: Facebook Share doesn't show my description or my thumbnail 这对我有用: Facebook Share不显示我的描述或我的缩略图

Just use URL encoding http://en.wikipedia.org/wiki/Percent-encoding 只需使用URL编码http://en.wikipedia.org/wiki/Percent-encoding

It seems you are using PHP, so you can simply use urlencode($url) when you construct the sharer URL (instead of just $url). 您似乎使用的是PHP,因此在构建共享URL(而不仅仅是$ url)时可以简单地使用urlencode($ url)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM