We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

Facebook share stripping my Joomla share link code

badwolfff
badwolfff asked
on
Medium Priority
759 Views
Last Modified: 2012-05-11
I am trying to share a link on facebook from my joomla site but facebook is stripping a part of my link.

The link I'd like to add is:
http://www.absolutproject.com/zuenelli/plugins/content/sige/plugin_sige/facebook.php?img=http%3A%2F%2Fwww.absolutproject.com%2Fzuenelli%2Fimages%2Fgalleries%2Fcamere_moderne%2FJESSE_HomeStyle_Pagina_38_Immagine_0001.jpg&name=JESSE_HomeStyle_Pagina_38_Immagine_0001

My syntax for adding this link is:
http://www.facebook.com/sharer.php?u=http://www.absolutproject.com/zuenelli/plugins/content/sige/plugin_sige/facebook.php?img=http%3A%2F%2Fwww.absolutproject.com%2Fzuenelli%2Fimages%2Fgalleries%2Fcamere_moderne%2FJESSE_HomeStyle_Pagina_38_Immagine_0001.jpg&name=JESSE_HomeStyle_Pagina_38_Immagine_0001

However after this link gets added on Facebook when I click on it I reach the following page:
http://www.absolutproject.com/zuenelli/plugins/content/sige/plugin_sige/facebook.php?img=http%3A%2F%2Fwww.absolutproject.com%2Fzuenelli%2Fimages%2Fgalleries%2Fcamere_moderne%2FJESSE_HomeStyle_Pagina_38_Immagine_0001.jpg

As you can clearly see the last part of the code is being stripped:
&name=JESSE_HomeStyle_Pagina_38_Immagine_0001

Why is this happening? When I am inside facebook and I try to share the link from within facebook, the whole link can be added without being stripped.

I am attaching my facebook.php file which genereates this page, should it be necessary.

What am I doing wrong and how can I fix this problem?

Thanks in advance.
facebook.php
Comment
Watch Question

Commented:
You should be using a URL shortner anyway, as those URLs are too long and complex to bookmark and share and will break. That is why it's cutting the link off.

Go to bit.ly and see whether you can get a URL shortening button integrated. Sharethis.com may also have similar options.

--Sam

Author

Commented:
Hi SamMacPC,

thanks so much for the idea. However there is snag in this. My links are generated on the fly and I can't go to bit.ly each time to generate a shorlink for each of them.
Is there a way I could generate the bit.ly link on the fly too?

thanks again

Author

Commented:
Hi SamMacPC
Do you know how the bit.ly api works?
Could I integrate it into my php code to generate links on the fly?
thanks again
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
the problem has been solved on another thread
https://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/Q_26984994.html

thanks all for your feedback
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.