我是php编程的新手,并试图将Facebook转换跟踪实施到我们网站激活新订阅者的部分。不幸的是,我在尝试浏览页面时收到错误消息。
以下是该页面的代码:
<?PHP
<head>
<script type="text/javascript">
var fb_param = {};
fb_param.pixel_id = '6014575463388';
fb_param.value = '0.01';
fb_param.currency = 'AED';
(function(){
var fpw = document.createElement('script');
fpw.async = true;
fpw.src = '//connect.facebook.net/en_US/fp.js';
var ref = document.getElementsByTagName('script')[0];
ref.parentNode.insertBefore(fpw, ref);
})();
</script>
<noscript><img height="1" width="1" alt="" style="display:none" src="https://www.facebook.com/offsite_event.php? id=6014575463388&value=0.01&currency=AED" /></noscript>
</head>
$queryString = $_SERVER['QUERY_STRING'];
include "../commonDbTasks.php";
$query = "Select * from User";
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result)){
if ($queryString == $row["ActivationKey"]){
echo "Congratulations!\nYour account is activated.";
// activate user
$sql="UPDATE User SET ActivationKey = '', Status='1' WHERE (ID = $row[ID])";
if (!mysql_query($sql)) {
die('Error: ' . mysql_error());
}
// exit;
}
}
// echo "This activation key is not valid"; // TODO why is this line executed ?? when the account is activated
?>
浏览页面时出现以下错误消息: 解析错误:语法错误,意外'&lt;'在第3行的/home1/dinersre/public_html/manageAccount/verify.php
这可能是一个完全的初学者错误,但是虽然花了几个小时浏览我没有找到任何有用的答案。
如果有人能指出我正确的方向,我将非常感激。
谢谢。