How can I share my blog post on Facebook in PHP?

I'm trying to share my individual blog posts from my websites blog onto facebook. Each post has a unique id as provided below, but the popup box is not changing the text content even tho the code is in unique divs with different id's, its just getting the first blog posts content.

This is what my blogs different id's use.

<? echo $blogitem_data['blogitem_id'] ?>

And the code I'm using

<script src='http://connect.facebook.net/en_US/all.js'></script>
    <p><a href="#" style="cursor:pointer;" title="Share <? echo $blogitem_data['blogitem_title'] ?> on facebook"onclick='postToFeed(); return false;' onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image9','','images/fb1a.png',1)"><img src="images/fb1.png" name="Image9" width="59" height="23" border="0"></a></p>
    <p id='msg'></p>

    <script> 
      FB.init({appId: "xxxxxxxxxxxxx59", status: true, cookie: false});

      function postToFeed(response) {

        // calling the API ...
        var obj = {
          method: 'feed',
          redirect_uri:'',
          link:'',
          picture: '',
          name: '- <? echo $blogitem_data['blogitem_title'] ?> ',
          caption: 'Welcome',
          description: '<? echo $string  ?> .'
        };

        function callback(response) {

        document.getElementById('divider-<? echo $blogitem_data['blogitem_id'] ?>').innerHTML = "Post ID: " + response['post_id'];
        }

        FB.ui(obj, callback);
      }

    </script>

Share Link In Facebook Php With Code Examples

Hello guys, in this post we will explore how to find the solution to Share Link In Facebook Php in programming.

<a name="fb_share" type="button" href="https://www.facebook.com/sharer.php?u=123.abc.com&t=TEst">share on Facebook</a>

As we have seen, the Share Link In Facebook Php problem was solved by using a number of different instances.

How do I share a link from my Facebook Page?

  • Tap in the top right of Facebook.
  • Tap Pages.
  • Go to your Page and tap Publish.
  • Add the link you want to share.
  • Tap Post.

Step-by-Step

  • Choose URL or Page. Pick the URL of a website or Facebook Page you want to share.
  • Code Configurator. Paste the URL to the Code Configurator and adjust the layout of your share button.
  • Copy & Paste HTML snippet. Copy and past the snippet into the HTML of the destination website.

Method 1: HTML

  • Step 1: Downloading or Creating a Logo.
  • Step 2: Go to the Facebook Page You Want to Add.
  • Step 3: Open the HTML Editor.
  • Step 4: Publish the Webpage.
  • Step 1: Choose a WordPress Plugin for Social Media Links.
  • Step 2: Customize.
  • Step 3: Add the Link to the Webpage.
  • How do I log in to Facebook and get the link?

If you want to post it on a particular page, you can also do that by including page id instead of user id in code. In the case of above a script, $posturl = '/'. $ fbUserId. '/feed'; instead of $ fbUserId you can put page id for e.g $posturl = '/XXXXXXXX/feed'; then the message will be posted on that particular page.

To share a link:

  • Scroll to the top of your Feed and tapWhat's on your mind
  • Enter the link.
  • Add an optional update.
  • Tap Post.

How do I post a link on Facebook 2022?

If you use the Facebook app on a mobile device: 1 – Tap the three dots in the top-right corner of the post. 2 – Tap Copy link. 3 – Now you can paste the copied URL into a new Facebook post, a comment on another post, a blog post, or an instant message or email. There you go.01-Jun-2022

To copy and paste URLs for content on your site, follow these steps:

  • Open a private or incognito window in your browser.
  • Without logging in, go to the page you want to share.
  • Copy the URL in the address bar.
  • Paste the URL wherever you're sharing your link, like on social media or in an email.

How do you post a link on Facebook without showing the URL?

How to post a link on Facebook without showing the URL:

  • Just paste the link into your status and wait for the link to load.
  • Wait…
  • When the image and text appear just delete the link and write your update. Simples.

If you post your website URL too many times in a short period, you might accidentally trigger the Facebook anti-spam algorithm, which could lead to a blocked URL. Or, you might've just gotten blocked through no fault of your own. Facebook's algorithms are not perfect and you can sometimes just be unlucky.12-May-2022

To make a hyperlink in an HTML page, use the <a> and </a> tags, which are the tags used to define the links. The <a> tag indicates where the hyperlink starts and the </a> tag indicates where it ends. Whatever text gets added inside these tags, will work as a hyperlink. Add the URL for the link in the <a href=” ”>.22-Dec-2021

How do I share a blog post on Facebook?

Log in to your Facebook account and find the Create post section at the top of the page. Type something about the blog post that you're sharing, and then paste the URL into the post directly below your text. After you've pasted the link, a preview of the blog post should populate below the text box.

How can I post on Facebook using PHP?

Automatically post to a Facebook page using the Facebook PHP API (v5).
Create a Facebook 'App': ... .
Install the Facebook PHP SDK: ... .
Enter your App's settings: ... .
Get a non-expiring Access Token for your App: ... .
The code that does the 'posting': ... .
The automation:.

How can I add Facebook share button in PHP?

Step-by-Step.
Choose URL or Page. Pick the URL of a website or Facebook Page you want to share..
Code Configurator. Paste the URL to the Code Configurator and adjust the layout of your share button. ... .
Copy & Paste HTML snippet. Copy and past the snippet into the HTML of the destination website..

How do I share my website content on Facebook?

Post your link on your wall and News Feed In order to do this, you'll want to paste your website's URL in the post box. You can find the post box in your Facebook Business Page under 'posts. ' Once you paste your URL, wait for a featured image of your website and title to appear.