Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/230.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 想在facebook上共享网站内容吗_Php_Facebook_Share - Fatal编程技术网

Php 想在facebook上共享网站内容吗

Php 想在facebook上共享网站内容吗,php,facebook,share,Php,Facebook,Share,我在facebook共享中遇到了一个问题:我想用php在facebook上发布内容、标题、URL,但除了URL之外,我无法发布所有内容 我有一个链接可以在facebook上分享 <a onClick="window.open('http://www.facebook.com/sharer.php?s=100&amp;p[title]= <?=$forum_list['subject']; ?>&amp;p[summary]= <?

我在facebook共享中遇到了一个问题:我想用php在facebook上发布内容、标题、URL,但除了URL之外,我无法发布所有内容

我有一个链接可以在facebook上分享

   <a onClick="window.open('http://www.facebook.com/sharer.php?s=100&amp;p[title]=
     <?=$forum_list['subject']; ?>&amp;p[summary]=
     <?= $forum_list['content'] ?>&amp;p[url]=
     <?php echo $url; ?>&amp;p[images][0]=
     <?php //$image;?>','sharer','toolbar=0,status=0,width=548,height=325');
       " href="javascript: void(0)">
     <img src="<?php echo BASE_URL; ?>img/face.png" />
   </a>
php仅将URL作为参数,它直接从URL读取Open Graph标记,您无法再动态设置任何内容


有关特定Open Graph标签的更多信息:

如何在facebook上共享我的网站内容。请检查
<!--use this meta tag -->

    <meta property="og:title" content="<?php echo $deal['deal_title'] ;?>" />
    <meta property="og:url" content="<?php echo $_SERVER['REQUEST_URI'];?>" />
    <meta property="og:image" content="http://domain.com/img/<?php echo $deal['deal_image']; ?>" />
    <meta property="og:image:type" content="image/jpeg" />
    <meta property="og:image:width" content="620" />
    <meta property="og:image:height" content="541" />

<!-- Put this ancor tag in your body -->
<a onclick="fb_Share();" title=" Facebook - Share And Earn"><img src="img/fb-earn.gif" alt=" Facebook - Share And Earn" width="299" height="60"></a>
<!-- use this Javascript -->

<script src="http://connect.facebook.net/en_US/all.js"></script>
   <script>
     function fb_Share(){
         FB.init({ 
            appId:'apID', cookie:true, 
            status:true, xfbml:true 
         });

         FB.ui({ method: 'feed',
                link: document.URL,
            },
            function(response) {
        if (response && !response.error_code) 
          {
               // you action    
          } 
       else 
           {
              alert(response);
          }
      }

            );
      }

      </script>