Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8948759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:04:45+00:00 2026-06-15T13:04:45+00:00

I am new to twitter,facebook etc api’s and javascripts. A similar question might be

  • 0

I am new to twitter,facebook etc api’s and javascripts.

A similar question might be asked by some one else but please check my question, I guess this question is not a duplicate one.

I am trying to share a url to facebook. Here is my code

<?php $link="www.google.com"> 
    <script>
        function fbs_click() 
        {
        u=location.href;
        t=document.title;
        window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');
        return false;
        }
        </script>
        <style>
        html .fb_share_button { display: -moz-inline-block; display:inline-block; padding:1px 20px 0 5px; height:15px;  background:url(http://static.ak.facebook.com/images/share/facebook_share_icon.gif?6:26981) no-repeat top right; } html .fb_share_button:hover { color:#fff; url(http://static.ak.facebook.com/images/share/facebook_share_icon.gif?6:26981) no-repeat top right; text-decoration:none; }
        </style> 
        <a rel="nofollow" href="http://www.facebook.com/share.php?u=<?php  echo $link;?>" 
        class="fb_share_button" onclick="return fbs_click()" target="_blank" style="text-align:center;"></a>
        </div>

But instead of sharing www.google.com it shows main url such as www.mysite.com/facebookshare.php where am i going wrong.

I also tried a simple anchor tag method to share but it disturbs my entire css.
exmaple

<a href = "http://www.facebook.com/sharer/sharer.php?u= <?php echo $link;?>">
                    <img src = "http://www.mysite.com/FB_2.png"></a>

Please help me to get the exact url i wish (www.google.com) to be shared to facebook.

Thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T13:04:46+00:00Added an answer on June 15, 2026 at 1:04 pm

    https://stackoverflow.com/questions/10566503/facebook-share-sharer-php-x-facebook-debugger?rq=1
    the sharer part of fb is no longer supported by fb you have to use the feed dialog part of javascript api https://developers.facebook.com/docs/reference/dialogs/feed/
    also make sure your og meta tags contain the correct information http://ogp.me/ that could be your problem

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to the Twitter API, but has used the Facebook API several times.
Simple question...I've noticed several large sites (Facebook, Twitter, etc) have ditched the idea of
I need that my application publish new status on Twitter and Facebook , but
I am using the following code to share some text via gmail,facebook,twitter, etc: Intent
Possible Duplicate: What's the shebang/hashbang (#!) in Facebook and new Twitter URLs for? I'm
New to twitter api. Requirement: Need to send direct messages to twitter followers of
I'm new to the twitter API https://dev.twitter.com/docs/api and I would like to incentivize users
I have twitter bootstrap setup to build in a new project, but am getting
Possible Duplicate: What's the shebang/hashbang (#!) in Facebook and new Twitter URLs for? Many
Possible Duplicate: What's the shebang/hashbang (#!) in Facebook and new Twitter URLs for? I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.