PHP 는 디버그 모드 안 되나요?
글쓴이: kknd345 / 작성시간: 월, 2005/06/20 - 5:15오후
게시판 만들고 있는데 에러화면은 안 뜨는데
화면에 아무것도 안 뜨네요.
어디서 잘 못 됏는지 모르겠습니다 ㅜㅜ...
<?
$pro_table = ( isset($HTTP_GET_VARS['table'])?$HTTP_GET_VARS['table']:'board_list');
include "config.php";
$conn = mysql_pconnect( $set_host, $set_user, $set_password);
mysql_select_db($set_dbname);
$pro_id = ( isset($HTTP_GET_VARS['id'])?$HTTP_GET_VARS['id']:0);
$pro_field = ( isset($HTTP_GET_VARS['field'])?strtolower($HTTP_GET_VARS['field']):"title");
$pro_search = ( isset($HTTP_GET_VARS['search'])?$HTTP_GET_VARS['search']:NULL);
$pro_start = ( isset($HTTP_GET_VARS['start'])?$HTTP_GET_VARS['start']:0);
if ( $pro_search != NULL )
{
$condition = " where $pro_field like '%$pro_search%' ";
$search_option = "&field=$pro_field&search=$pro_search";
}
$query = "select id, num, title, DATA_FORMAT(w_time,'%Y/%m/%d') as w_date, writer, lv, cnt from $pro_table $condition order by num desc, od asc, lv asc limit'.($pro_start*10-).',$Title_Num";
$result = mysql_query( $query );
$num = @mysql_num_rows($result);
if ( $num > 0 ) // 게시물이 존재할 때
{
for ( $i=0; $i < $num ; $i++)
{
$data = mysql_fetch_array($result);
$space = " ";
if ( $data[lv] > 0 ) // lv 가 답글 수를 저장하고 있다.
{
$data[num] = "+";
for ( $j=0; $j< $data[lv]; $j++)
$space.=" ";
$space.="@";
}
$LIST .= "<tr bgcolor='EFEFFF' height=20 align='center' >
<td>$data[num]</td>
<td align = 'left'>$space
<a href='view.php?table=$pro_table&id=$data[id]&start=$pro_start$search_option'
class='title'>".stripslashes($data[title])."</a><td>
<td>".Stripslashes($data[writer])."</td>
<td>$data[w_date]</td>
<td>$data[cnt]</td>
</tr> "; // 결과와 링크를 결함하여 타이틀제목을 테이블 형태로 만든다.
}
}
else // 게시물이 존재하지 않을 경우
$LIST = "<tr bgcolor = '#EFEFFF' align = 'center' ><td colspan=5 height=200><font color=blue> 게시물이 존재하지 않습니다 </font><td></tr>";
$c_res = mysql_query ( "select count(id) as cid from $pro_table $condition ");
$count = @mysql_result ( $c_res, 0,"cid");
if ( $count > $Title_Num )
{
$end = ceil ( $count / $Title_Num); // 마지막 페이지 번호를 계산한다.
for ( $i = 1; $i <= end ; $i++ )
{
if( $i != $pro_start + 1)
$short_cut .= " [<a href = 'list.php?table=$pro_table&start= ".($i-1).$search_option."'>$i</a>]";
else
$short_cut .= "<b>[$i]</b>";
}
}
else $short_cut = "[1]";
if ( $pro_start > $ShortCut_Num )
{
$prev_link = "<a href='list.php?table=$pro_table&start".(floor($pro_start/$ShortCut_Num)*$ShortCut_Num)."$search_option'><<</a>";
}
else
$prev_link = "<<";
if ( $count > ($Title_Num * $ShortCut_Num ) )
{
$next_link = "<a href = 'list.php?table=$pro_table&start=".( ceil($pro_start / $ShortCut_Num)*$ShortCut_Num+1)."$search_option'>>></a>";
}
else
$next_link = ">>";
mysql_close();
// Admin login 링크
if ( auth() )
{
$admin_link = "<input type='button' name='admin' class = '2daybutton' onclick=\"login=window.open('logout.php','_blank','width=300,height=150,scrollbars=no, menubar=no, resizable=no, status=no')\" value='Logout'>";
}
else
$admin_link="<input type='button' name='admin' class = '2daybutton' onclick=\"login=window.open('login.php','_black','width=300,height=150,scrollbars=no, menubar=no, resizable=no, status=no')\" value='Login'>";
// HTML Code를 출력한다.
echo "<html><head><title>Board<title>
<style>
a:active,a:link, a:visited { font-size:9pt; color:black; text-decoration:none;}
a.title:active, a.title:link { font-size:9pt; color:black; text-decoration:none;}
a.title:visited { font-size:9pt; color:green; text-decoration:none;}
a:hover { font-size:9pt; color:black; text-decoration:none;}
td { font-size:9pt; color:black;}
td.head { font-size:9pt; color:white; background-color:#111188; text-align:center;}
td.menu { font-size:9pt; background-color:white; color:navy; }
td.button { font-size:9pt; background-color:#EEEEEE; cursor:hand;}
tr {text-align:center;}
.2daybutton{ font-size:9pt; border-left:1px solid; border-right:1px solid; border-bottom:1px solid; border-top:1px solid }
</style>
<script language='Javascript'>
function Search_it()
{
if ( search.value != \"\" )
document.location.href='./list.php?table=$pro_table&field='+field.value+'&search='+search.value;
else
document.location.href='./list.php?table=$pro_table';
}
</script></head>
<body><table border=0 width=610->
<tr><td> <table width='10-0' border='0' cellspacing='1' align='left' valign='bottom'>
<tr><td class='menu'> $admin_link</td></tr></table>
<table width='260' border='0' cellpadding='0' cellspacing='3' align='right'><tr>
<td width='60'>
<select name='field' class='border'>
<option value = 'title'>제목</option>
<option value='passage'>내용</option>
<option vlaue='writer'>글쓴이</option>
</select></td>
<td width='200'>
<input type='text' name='search' size='20' maxlength='30' class='2daybutton'>
<input type='button' name='press' value='검 색' class='2daybutton' onclick='Search_it()'>
</td></tr>
</table></td></tr>
<tr><td><table width=600 border=0 cellpadding=0 cellspacing=1 bgcolor='black'>
<tr height=20>
<td width=50 class='head'> 번호 </td>
<td width=300 class='head'> 제목 </td>
<td width=100 class='head'> 이름 </td>
<td width=100 class='head'> 날짜 </td>
<td width=50 class='head'> 조회수 </td>
</tr>
<!--리스트 출력 시작 -->
$List
<!--리스트 출력 끝 -->
<tr height=20>
<td class='menu' colspan=3>$prev_link $short_cut $next_link </td>
<table bgcolor='black' width='10-0' cellspacing='1'>
<tr>
<td class='button' onclick=\"location.href='./writeform.php?table=$pro_table';\">글쓰기</td>
</tr></table></td></tr></table></td></tr></table>
</body>
</html> ";
?>
Forums:


php.ini 파일의error_reporting 항목을E_ALL
php.ini 파일의
error_reporting 항목을
E_ALL 혹은 E_ALL & ~E_NOTICE & ~E_STRICT로 수정해 주시면 될듯..
혹은 ini_set으로 해당 값을 바꿔줘도 될듯
list.php 소스 자체의 문제인거 같습니다 ... 에러는 없는
list.php 소스 자체의 문제인거 같습니다 ...
에러는 없는데 그냥 안 뜨는거 같네요 ...
제발 좀 도와주세요 ㅜㅜ..
1%의 가능성이면 충분하다!
최선을 다하자!
error_reporting(E_ALL);php.ini 를 수정하
error_reporting(E_ALL);
php.ini 를 수정하면 아파치 재시동을 해야 합니다.
php 코드 맨 위에 간단히 저 줄을 추가해서 보세요.
아니면 short_tag 가 off 로 되어있어서
소스코드가 그대로 뿌려진걸지도...
<?php
---
뱀꼬리
php 버전이 매우 낮은가봐요 $HTTP_GET_VARS 가 짧게 $_GET 으로 바뀌었습니다.
https://xenosi.de/
[quote]php 버전이 매우 낮은가봐요 $HTTP_GET_VARS 가
보고 있는 책이 오래된거라 그렇습니다 ^^;;;
PHP버전은 최근버전 깔았는데요
$HTTP_GET_VARS 쓰면 안되나요?
1%의 가능성이면 충분하다!
최선을 다하자!
익스프롤러에서 실행시키고 오른쪽 버튼 눌러서 소스보기 한 결과 아래와 같
익스프롤러에서 실행시키고 오른쪽 버튼 눌러서 소스보기 한 결과 아래와 같은 HTML이 만들어지네요. 그런데 왜 화면에는 왜 아무것도 안 보이는거죠 ㅜㅜ..
<html><head><title>Board<title> <style> a:active,a:link, a:visited { font-size:9pt; color:black; text-decoration:none;} a.title:active, a.title:link { font-size:9pt; color:black; text-decoration:none;} a.title:visited { font-size:9pt; color:green; text-decoration:none;} a:hover { font-size:9pt; color:black; text-decoration:none;} td { font-size:9pt; color:black;} td.head { font-size:9pt; color:white; background-color:#111188; text-align:center;} td.menu { font-size:9pt; background-color:white; color:navy; } td.button { font-size:9pt; background-color:#EEEEEE; cursor:hand;} tr {text-align:center;} .2daybutton{ font-size:9pt; border-left:1px solid; border-right:1px solid; border-bottom:1px solid; border-top:1px solid } </style> <script language='Javascript'> function Search_it() { if ( search.value != "" ) document.location.href='./list.php?table=board_list&field='+field.value+'&search='+search.value; else document.location.href='./list.php?table=board_list'; } </script></head> <body><table border=0 width=610> <tr><td> <table width='10-0' border='0' cellspacing='1' align='left' valign='bottom'> <tr><td class='menu'> <input type='button' name='admin' class = '2daybutton' onclick="login=window.open('login.php','_black','width=300,height=150,scrollbars=no, menubar=no, resizable=no, status=no')" value='Login'></td></tr></table> <table width='260' border='0' cellpadding='0' cellspacing='3' align='right'><tr> <td width='60'> <select name='field' class='border'> <option value = 'title'>제목</option> <option value='passage'>내용</option> <option vlaue='writer'>글쓴이</option> </select></td> <td width='200'> <input type='text' name='search' size='20' maxlength='30' class='2daybutton'> <input type='button' name='press' value='검 색' class='2daybutton' onclick='Search_it()'> </td></tr> </table></td></tr> <tr><td><table width=600 border=0 cellpadding=0 cellspacing=1 bgcolor='black'> <tr height=20> <td width=50 class='head'> 번호 </td> <td width=300 class='head'> 제목 </td> <td width=100 class='head'> 이름 </td> <td width=100 class='head'> 날짜 </td> <td width=50 class='head'> 조회수 </td> </tr> <!--리스트 출력 시작 --> <!--리스트 출력 끝 --> <tr height=20> <td class='menu' colspan=3><< [1] >> </td> <table bgcolor='black' width='10-0' cellspacing='1'> <tr> <td class='button' onclick="location.href='./writeform.php?table=board_list';">글쓰기</td> </tr></table></td></tr></table></td></tr></table> </body> </html>1%의 가능성이면 충분하다!
최선을 다하자!
table 태그가 닫히지 않았습니다.
...
BINGO...
어이없는 곳에 오류가 있었네요..
문제의 위치는
echo "<html><head><title>Board<title>"99번째 줄입니다.
이 곳을 보면 title태그가 두번 쓰였습니다. 원래 의도는 Board가 제목에 나타나면 되는데 닫는 태그가 아니고 다시 열리는 태그가 작성이 되어 있어서 이후 모든 내용이 제목으로 인식되었네요..
그리고 한가지 더 151번째 줄에 $List 라고 되어 있는데 $LIST를 잘 못 적었다고 보이네요..
즐코~~
정말 고맙습니다. 어처구니 없는 실수를 했네요 ㅜㅜ... 이것때문
정말 고맙습니다.
어처구니 없는 실수를 했네요 ㅜㅜ... 이것때문에 몇시간을 해맷는지.... 정말 고맙습니다.
1%의 가능성이면 충분하다!
최선을 다하자!
댓글 달기