2

I have an url i would like users to share using 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 $url is the url i would like to share. the structure of my url is as follows

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.

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?

Clive
  • 36,918
  • 8
  • 87
  • 113
Elric Wamugu
  • 133
  • 4
  • 10
  • "Make sure you URL encode the u and t parameters" - See http://developers.facebook.com/docs/share/ towards the bottom under "Creating Your Own Share URL" – AllisonC Nov 14 '11 at 13:24

3 Answers3

6

Send your entire url encoded. So & of your url will be replaced with %26. I found it. Thanks for your question.

IamSalik
  • 123
  • 1
  • 7
  • This one works. The accepted answer doesn't work. I didn't even have to encode the entire URL, I just had to change `&variable=value` to `%26variable=value`. – M - Dec 11 '14 at 21:33
1

Try changing your & to &. This worked for me: Facebook Share doesn't show my description or my thumbnail

Community
  • 1
  • 1
Drew
  • 3,194
  • 8
  • 40
  • 62
1

Just use URL encoding 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).

Nikolay Dimitrov
  • 1,766
  • 1
  • 14
  • 23