2011-05-08 3 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

+0

아파치 오류 로그를 확인 했습니까? – Brombomb

+1

최근 버전의 PHP는 브라우저 대신 아파치 오류 로그에 쓰는 것이 기본값입니다. 저길 봐. – Magicianeer

답변

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

관련 문제