我正在使用类似Facebook的按钮。它工作,显示我的域名和我的网站上的图像。但我想在墙上显示变量$submission
。我怎样才能做到这一点?
Like按钮:
echo '<div class="like2">';
echo '<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like href="http://www.domain.com/directory/directory/fblike.php?submissionid='.$submissionid.'&submission='.$submission.'&uid='.$uid.'" send="true" layout="button_count" width="150" show_faces="false" font="arial"></fb:like>';
echo '</div>';
在www.domain.com/directory/directory/fblike.php
:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<div class="hslogo"><a href="http://www.domain.com/directory/"><img src="images/image.png" alt="Name" border="0"/></a></div>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php
session_start();
$submissionid = $_GET['submissionid'];
$uid = $_GET['uid'];
$submission = $_GET['submission'];
?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo urldecode($submission); ?></title>
<meta property="og:title" content="FB Like Page Test"/>
</head>
<body>
<?php
mysql_connect("server", "username", "password") or die(mysql_error());
mysql_select_db("database") or die(mysql_error());
echo $submission;
$q = "INSERT INTO fblikes VALUES (NULL, '$submissionid', '$uid', NULL)";
$r = mysql_query($q);
if($r) //voting done
{
// echo "Success!";
}
elseif(!$r) //voting failed
{
// echo "Failed!";
}
header("Location: index.php?submission=".urlencode($submission)."&submissionid=".$submissionid"&uid=".$uid.");
?>
</body>
</html>
答案 0 :(得分:0)
我想你可能会过度思考这个