<?php
$title=urlencode('Nature');
$url=urlencode('http://trainees.ocs.org/training/hariharan/01-09-2014/facebook.php');
$image=urlencode('http://trainees.ocs.org/training/hariharan/01-09-2014/images/img1.jpg');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Sharing Images on Facebook</title>
<link href="css/facebook.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="all">
<div class="top">
<div class="img"><img src="images/img1.jpg" height="220" width="550" /></div>
<div class="share"><a onClick="window.open('http://www.facebook.com/sharer.php?s=100&p[title]=<?php echo $title;?>&p[url]=<?php echo $url; ?>&&p[images][0]=<?php echo $image;?>','sharer','toolbar=0,status=0,width=550,height=220');" href="javascript: void(0)">Share</a></div>
<p> </p>
</div>
</div>
</body>
</html>
上面的代碼是通過PHP共享Facebook上的圖像。但該圖片無法顯示在我的帳戶中。如何使用PHP在Facebook上分享圖像?...請幫助我的朋友。在facebook上分享通過php的圖像
股份對話框不會採取任何額外的參數之外的URL分享更多的 - 所有其他信息(標題,描述,圖片)將被從該URL下的文件中包含的Open Graph meta標籤服用。 – CBroe 2014-09-01 11:12:02