无法在Facebook上共享图像shar.php

时间:2015-06-13 14:30:13

标签: javascript php html css facebook

我正在尝试与特定图片分享我的网站网址,但我无法这样做。我尝试了两种方法但似乎都没有工作。

方法1:

shows black image
    <meta property="og:title" content="Default Description"/>
    <meta property="og:type" content="Default Description"/>
    <meta property="og:url" content="http://vmallonline.com/"/>
    <meta property="og:image" content="http://vmallonline.com
        /skin/frontend/estore/default/images/logo.png"/>
    <meta property="og:site_name" content="IMDb"/>
    <meta property="og:description"
          content="A group of U.S. Marines, under command of
                   a renegade general, take over Alcatraz and
                   threaten San Francisco Bay with biological
                   weapons."/>
    <a href="http://www.facebook.com/sharer/sharer.php?
      u=http://myurl.com/">share it
    </a><br />

方法2
此方法在Facebook上不显示图像

<?php
$title=urlencode('Title of Your iFrame Tab');
$url=urlencode('http://myurl.com/');
$summary=urlencode('Custom message that summarizes what your tab is 
about, or just a simple message to tell people to check out your tab.');
$image=urlencode('http://myurl.com/skin/frontend/estore/default/images/logo.png');
?>


<a onClick="window.open(
  'http://www.facebook.com/sharer.php?s=100&amp;p[title]=<?php echo $title;?>
   &amp;p[summary]=<?php echo $summary;?>
   &amp;p[url]=<?php echo $url; ?>
   &amp;p[images][0]=<?php echo $image;?>
   ','sharer','toolbar=0,status=0,width=548,height=325');" 
   href="javascript: void(0)">Insert text or an image here.</a>

0 个答案:

没有答案