473,387 Members | 1,582 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

share products on Facebook

I am trying to share my products image on Facebook but somethings gos wrong with the URL of the products I used this code on the header of the page

Expand|Select|Wrap|Line Numbers
  1. (function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
  2.     fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));
and than I used this for my share Icon

Expand|Select|Wrap|Line Numbers
  1. <a href="https://www.facebook.com/sharer/sharer.php?u=<?php echo "https%3A%2F%2F$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; ?>" target="_blank"><img src="images/facebook.png" class="f_right m_left_right_5px" width="30" height="30"  alt="facebook"/></a>
I used this PHP code to get the link of the products

Expand|Select|Wrap|Line Numbers
  1. https%3A%2F%2F$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]
the link should appear something like this

Expand|Select|Wrap|Line Numbers
  1. https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fnadim.org/new2/index.php?pid=v4&prodid=136&cat=1
but in the share box it appear like that

Expand|Select|Wrap|Line Numbers
  1. https://nadim.org/new2/index.php?pid=v4
what did I made wrong. thanks
Dec 19 '13 #1

✓ answered by Yousef Altaf

OK I should answer this now so anybody has the same problem should take care about this
in my URL that I am trying to get
it should look like this
Expand|Select|Wrap|Line Numbers
  1. https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fnadim.org/new2/index.php?pid=v4&prodid=136&cat=1
the all problem was this
Expand|Select|Wrap|Line Numbers
  1. &
when I replaced with this
Expand|Select|Wrap|Line Numbers
  1. &amp;
everything worked fine for me

thanks and regards for all.
Yousef

1 2840
OK I should answer this now so anybody has the same problem should take care about this
in my URL that I am trying to get
it should look like this
Expand|Select|Wrap|Line Numbers
  1. https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fnadim.org/new2/index.php?pid=v4&prodid=136&cat=1
the all problem was this
Expand|Select|Wrap|Line Numbers
  1. &
when I replaced with this
Expand|Select|Wrap|Line Numbers
  1. &amp;
everything worked fine for me

thanks and regards for all.
Yousef
Feb 18 '14 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: Dual_b00t | last post by:
Hi I am a beginner PHP programmer so I decided i would create a facebook group for us newbs to share and help each other out.. http://www.facebook.com/group.php?gid=20845788472 its brand new...
0
by: waqasahmed996 | last post by:
Hi i am not sure whether am i posting this message on right section. i have a website to share quotes on Facebook. (http://www.screamd.com/) Actually i am using Link Button on my site. Two...
0
by: Keith Boesker | last post by:
I'm trying to get FaceBook Share to use my title and description. I've tried everything I've Google but none of it works for me. I think I need to tell Facebook where to get the data. I'm using HTML...
3
by: phpuser123 | last post by:
This page is suposed to display a title ,description and image as I press the Compartir de facebook.I've used meta tags for the purpose ..However, they are not displayed. Anyone could guide me on how...
0
by: hamasat | last post by:
when i try to post a comment (share link) on an article from my page which is actually a page i am using as an application in facebook : https://apps.facebook.com/ids_newsletter/ , facebook chooses...
4
by: CygnetInfo | last post by:
Hello Guys As I had discussion with my friend regarding a share on Facebook.Suppose a person having a friend list of thousand friend and he share a image,video,or funny note. Is all the thousand...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.