I’m trying to integrate facebook share by using images directly from my database.
Static images using the OG tags:
<meta property="og:image" content="http://X.com/image.jpg" />"
Works fine.
However, my images are not static, they are being called from my database using this:
echo "<img src=\"pic.php?id=".$id."\"/>";
Where pictures render fine on my website but facebook share does not pick them up.
The logical thing in my mind then would be to do this:
echo "<meta property=\"og:image\" content=\"http://X.com/pic.php?id=".$id."\"/>";
Sadly, this does not work.
Additionally, using rewrite engine to reform the URL:
http://x.com/pic/id
http://x.com/pic/id.jpg
Does not work either.
Any ideas?
Not a solution – but this may help; facebook has a great tool called Debugger. You use it to see how facebook views your URL. This tool will alert you when your
og:tagsare missing or malformed.It can also be used to decode access tokens.