2011-05-08 84 views
0

我在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> 
+2

可你至少熬下來到你認爲它可能是什麼?我們不知道你的錯誤是什麼,或者在沒有解碼所有代碼的情況下可能會出現這種情況。編輯:也許它是你的包括後的作品?你有一個字符串(沒有分配)什麼也沒有;) – robx 2011-05-08 03:57:17

+0

你檢查了Apache錯誤日誌? – Brombomb 2011-05-08 04:07:49

+1

最近的PHP版本默認寫入apache錯誤日誌而不是瀏覽器。看這裏。 – Magicianeer 2011-05-08 04:11:01

回答

3

在第二個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 } ?> 

你可以嘗試:

} ?> 
+0

哇,+1只是經歷了這個爛攤子並且真正找到了東西。 – eykanal 2011-05-08 04:22:43

相關問題