簡體   English   中英

有誰知道可能導致此致命錯誤的原因?

[英]Does anyone know what could cause this fatal error?

我在MAMP上的PHP錯誤無法正常工作,我已將其打開,但仍然沒有任何反應。
那里有錯誤,我看了看又找不到任何東西。
它什么也沒返回,所以我猜這是一個致命的錯誤。

<?php include("scripts/config.php");
include("scripts/facebook.php");

"INSERT INTO likes (like, pop, date)
VALUES ('$_POST[like_box]','0', now())";       
?>

<!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 content="en-gb" http-equiv="Content-Language" />
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>theupdate</title>
<link rel="stylesheet" type="text/css" href="main.css" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
//More Button
$('.more').live("click",function() 
{
  var ID = $(this).attr("id");
  if(ID)
  {
    $("#more"+ID).html('<img src="moreajax.gif" />');

    $.ajax({
      type: "POST",
      url: "new/ajax_more.php",
      data: "lastmsg="+ ID, 
      cache: false,
      success: function(html){
      $("ol#updates").append(html);
      $("#more"+ID).remove();
    }
  });
}else{
  $(".morebox").html('no more posts to display'); 
}
return false;

});
});

</script>

<style>a { text-decoration:none; color:#0066CC}
a:hover { text-decoration:underline; color:#0066cc }
*
{
    margin: 0px;
    padding: 0px;
}
ol.timeline
    { list-style:none}ol.timeline li{ position:relative;border-bottom:1px #dedede dashed; padding:8px; }ol.timeline li:first-child{}
    .sssss {
    color: #ededed;
    height:1px;
}

    .morebox
    {
    font-weight:bold;
    color:#333333;
    text-align:center;
    border:solid 1px #333333;
    padding:8px;
    margin-top:8px;
    margin-bottom:8px;
    }
    .morebox a{ color:#333333; text-decoration:none}
    .morebox a:hover{ color:#333333; text-decoration:none}
    #container{margin-left:60px; width:580px }

.style11113 {
    font-family: Arial, Helvetica, sans-serif;
}

.style11114 {
    text-align: left;
}
.style11115 {
    font-family: Arial, Helvetica, sans-serif;
    font-size: medium;
}

.style11117 {
    font-family: "Trebuchet MS", "Lucida Sans Unicode", "Lucida Grande", "Lucida Sans", Arial, sans-serif;
    font-size: medium;
}

.style11118 {
    text-align: right;
}
.style11119 {
    color: #ededed;
    text-decoration: none;
    font-family: "lucida grande", tahoma, verdana, arial, sans-serif;
    margin-top: 13px;
}
.style11120 {
    margin-top: 0px;
}

.style11121 {
    margin-bottom: 0px;
}

.style11122 {
    font-family: "Trebuchet MS", "Lucida Sans Unicode", "Lucida Grande", "Lucida Sans", Arial, sans-serif;
    font-size: small;
    text-align: left;
    margin-top: 4px;
}

.style11123 {
    font-size: x-small;
}

</style>

</head>
<body>
<div align="center">
    <div align="left" style="height: 36px; width: 954px; background-color:#7B0004;" >
        <table style="width: 100%; height: 32px" class="style4">
            <tr>
                <td style="height: 30px; width: 144px;">&nbsp;&nbsp;&nbsp;<span class="style11113"><strong>facebook quotes</strong></span></td>
                <td style="height: 30px; width: 594px;"><a href="new.php" class="style4">new likes</a> &nbsp;<a href="popular.php" class="style4">popular 
                likes</a></td>
                <td style="height: 30px"><a href="http://www.facebook.com" class="style4">back 
                to facebook.com</a></td>
            </tr>
        </table>
    </div>
    <div style="border-left: 1px solid #b3b3b3; border-right: 1px solid #b3b3b3; border-top: 0px; border-bottom: 1px  solid #b3b3b3; width: 859px; height: 545px; ">
        <div style="height: 564px; width: 952px;">
            <div style="width: 297px; float:right; height: 538px;">
                <?php
$sql=mysql_query("select * from likes ORDER BY date DESC LIMIT 9");
while($row=mysql_fetch_array($sql))
{

$like_count = $facebook->api(array(  
    'method' => 'fql.query',  
    'query' => 'select like_count from link_stat where url = "http://www.quotefacebook.com/like.php?id=$row['id']"'
));

mysql_query("UPDATE likes WHERE id=$row['id'] SET pop=$like_count")

?>


<?php } ?>
</div>



            <div style="width: 654px; float:left; height: 540px;" class="style11114">
                <div class="style11114">
                    <span class="style11115">&nbsp;</span><span class="style11117">create a facebook like..</span><br /></div>
                <form method="post" action="self">
                    <div class="style11118">


                        <table class="style11120" style="width: 100%; height: 59px">
                            <tr>
                                <td style="width: 648px">
                                <textarea name="TextArea1" style="width: 524px; height: 52px"></textarea>&nbsp;</td>
                            </tr>
                            <tr>
                                <td class="style11118" style="width: 648px">
                                <input name="Submit1" style="width: 78px" type="submit" value="submit">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
                                &nbsp;</td>
                            </tr>
                        </table>
                                                <hr class="sssss " noshade="noshade" style="height: 1px" />

                    </div>
                </form>

            <?php 
$sql=mysql_query("select * from likes ORDER BY date DESC LIMIT 9");
while($row=mysql_fetch_array($sql))
{
$like_count = $facebook->api(array(  
    'method' => 'fql.query',  
    'query' => 'select like_count from link_stat where url = "http://www.quotefacebook.com/like.php?id=$row['id']"'
));
*
mysql_query("UPDATE likes WHERE id=$row['id'] SET pop= " . $like_count . "")

?>


                <table style="width: 100%; height: 7px;" class="style11119">
                    <tr>
                        <td style="width: 68px; height: 23px;" class="style11111 " valign="top">
                        <div id="fb-root">
                        </div>
                        <script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
                        <fb:like href="http://www.quotefacebook.com/like.php?id=<?php print $row['id']; ?>" send="false" layout="button_count" width="0" show_faces="false" font="">
                        </fb:like>
                        </td>
                        <td style="height: 23px" class="style11112"><?php print $row['like']; ?>
                        </td>
                    </tr>
                    <tr>
                        <td style="height: 23px;" class="style1" colspan="2" valign="top">
                        <hr class="sssss " noshade="noshade" style="height: 1px" />
                        </td>
                    </tr>
                </table>
<?php } ?>
                <div id="more<?php echo $msg_id; ?>" class="morebox">
                    <a href="#" class="more" id="<?php echo $msg_id; ?>" style="font-family:Arial, 'Helvetica', sans-serif;
">more</a> </div>
</div>



            <div class="style11121">

<div style="width: 939px; height: 16px;" class="style11122">
    <span class="style11123">this website is not associated with facebook in anyway, 
    at all.. seriously.&nbsp; </span>
    <span class="style11123" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: arial, sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">
    <span class="Apple-style-span" style="line-height: 15px; ">© 2011</span></span></div>

            </div>



            </div>
    </div>
</div>

</div>

</body>

</html>

在第二個while循環中,您的代碼中有一個隨機的星號字符。 您還會在此行的PHP語句中缺少兩個分號:

mysql_query("UPDATE likes WHERE id=$row['id'] SET pop=$like_count")

這條線

mysql_query("UPDATE likes WHERE id=$row['id'] SET pop= " . $like_count . "")

如果那不能解決您的錯誤,則在包含之后,您將:

"INSERT INTO likes (like, pop, date)
VALUES
('$_POST[like_box]','0', now())";

它是未分配給任何東西的字符串。 它可能導致您的錯誤。 取出並嘗試。 如果這不是問題的根源,請查看您的位置:

"UPDATE likes WHERE id=$row['id'] SET pop=$like_count"

我會在數組變量和字符串的其余部分之間添加一個點,這樣它將變成:

"UPDATE likes WHERE id=".$row['id']." SET pop=$like_count"

我將在您執行此操作的多個位置進行此更新。

另外,在第一個while循環之后的多余PHP標記確實是不必要的。 您可以正常關閉while循環。 所以代替:

?>


<?php } ?>

您可以嘗試:

} ?>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM