for 사용해더니 안되네요 ㅠ.ㅠ 답변좀.. 정보
그누보드 for 사용해더니 안되네요 ㅠ.ㅠ 답변좀..본문
1번식으로 해도 에러발생
for($i=1;$i<=4;$i++)
{
echo "<img src=./data/file/$board[bo_table]/$row[wr_file".$i."]>";
}
2번식으로 해도 에러 발생
<?
for($i=1; $i <= 3; $i++) {
echo "<img src=\"./data/file/".$board[bo_table]."/".$row[wr_file{$i}\]."\">";
}?>
Parse error: parse error, unexpected '"', expecting ']' in
gbview.skin.php 파일 입니다.
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
if (!$skin_no) $skin_no = "01";
?>
<link rel='stylesheet' href='<?=$board_skin?>/style<?=$skin_no?>.css' type='text/css'>
<table width='<?=$width?>' align=center border=0 cellpadding=0 cellspacing=0><tr><td>
<table width='100%' border=0 cellpadding=0 cellspacing=0>
<tr>
<td colspan=2 class=line></td>
</tr>
<tr class=ct>
<td><font color=#000000><b>
<? if ($is_category) echo "[$category_name] "; ?>
[우편번호 :
<?=$member[mb_zip1]?>
-
<?=$member[mb_zip2]?>
]
<?=$subject?>
</b></font></td>
<td align=right>
<?=$datetime?>
</td>
</tr>
<tr class=ct>
<td> <font color=#000000><b> 전화번호 :
<?=$member[mb_tel]?>
HP:
<?=$member[mb_hp]?>
이름 : <?=$name?>
</b></font></td>
<td align=right><span class=wview>
(<?=$ip?>)</span>
</td>
</tr>
<tr>
<td colspan=2 height=1 bgcolor=#D4CFC3></td>
</tr>
<tr>
<td colspan=2>
<table width=100% cellpadding=5>
<tr>
<td style='word-break:break-all;' class='lh' height=100>
<?
echo " <table width='700' border=0 cellpadding=0 cellspacing=0><tr>";
$row=$write;
for ($i=1; $i<=5; $i++) {
echo "<td>";
if ($file[$i][view]) { echo $file[$i][view];echo "$file1_[$i]";
echo "<img src=./data/file/$board[bo_table]/$row[wr_file".$i."]>";
}
if ($file[$i][source]) { echo "<span class=wview>Download</span> :
<a href='{$file[$i][href]}'>{$file[$i][source]} ({$file[$i][size]})</a>";}
echo "</td>";
}
echo "</td></tr></table>";
echo " <table width='700' border=0 cellpadding=0 cellspacing=0><tr>";
for ($i=6; $i<=10; $i++) {
echo "<td>";
if ($file[$i][view]) { echo $file[$i][view]; }
if ($file[$i][source]) { echo "<span class=wview>Download</span> :
<a href='{$file[$i][href]}'>{$file[$i][source]} ({$file[$i][size]})</a>";}
echo "</td>";
}
echo "</td></tr></table>";
?>
<p>
<?$row=$write;?>
<img src='./data/file/<?=$board[bo_table];?>/<?=$row[wr_file1];?>' width='100' align='center' style='border:1 solid #222222'>
</p></td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<? if ($is_comment) { ?>
<? if ($is_comment_write) { ?>
<!-- 코멘트 쓰기 -->
<table width=<?=$width?> align=center cellpadding=10 cellspacing=0 border=0 bgcolor=#F5F5F5>
<form name=fgbview method=post action='./?doc=bbs/gbupdate.php'>
<input type=hidden name=w value='c'>
<input type=hidden name=bo_table value='<?=$bo_table?>'>
<input type=hidden name=sselect value='<?=$sselect?>' >
<input type=hidden name=stext value='<?=$stext?>'>
<input type=hidden name=wr_id value='<?=$wr_id?>'>
<input type=hidden name=page value='<?=$page?>'>
<input type=hidden name=section value='<?=$section?>'>
<tr>
<td align=center>
<table width=100% cellpadding=0 cellspacing=0 bgcolor=#FFFFFF border=0>
<tr>
<td colspan=2 align=center>
<table width=98% cellpadding=0 cellspacing=0>
<tr>
<td>
<textarea name=wr_content style='width:100%; line-height:150%;' rows=5 required itemname='내용' class=textarea></textarea>
</td>
<td width=64>
<input type=image src='<?="$board_skin/btncomment.gif"?>' border=0 align=absmiddle>
</td>
</tr>
<tr>
<td colspan=2 height=5></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</form>
</table><br>
<? } // if ?>
<!-- 코멘트 내용 -->
<? for ($i=0; $i<count($list); $i++) { ?>
<a name='c<?=$list[$i][wr_id]?>'></a>
<table width=<?=$width?> border=0 align=center cellpadding=0 cellspacing=0>
<tr>
<td height=25> <?=$list[$i][name]?> (<?=$list[$i][ip]?>) <? if ($list[$i][is_del]) { echo "{$list[$i][del_href]}<img src='$board_skin/com_del.gif' border=0 align=absmiddle></a> "; } ?></td><td align=right><?=$list[$i][datetime]?> </td>
</tr>
<tr>
<td valign=top colspan=2>
<table width=100% cellpadding=7 cellspacing=0>
<tr>
<td class='comment'><?=$list[$i][content]?> </td>
</tr>
</table>
</td>
</tr>
<tr><td colspan=2 height=1 bgcolor=#DADADA></td></tr>
</table><br>
<? } // for ?>
<? } // if ?>
<!-- 링크 -->
<table width='100%' border=0 cellpadding=0 cellspacing=0>
<tr>
<td width=70% height=35>
<? if ($search_href) { echo "<a href=\"$search_href\"><img src='$board_skin/searchlist.gif' border=0 alt='검색목록' align=absmiddle></a>"; } ?>
<? echo "<a href=\"$list_href\"><img src='$board_skin/list.gif' border=0 alt='목록' align=absmiddle></a>"; ?>
<? if ($write_href) { echo "<a href=\"$write_href\"><img src='$board_skin/write.gif' border=0 alt='글쓰기' align=absmiddle></a>"; } ?>
<? if ($update_href) { echo "<a href=\"$update_href\"><img src='$board_skin/edit.gif' border=0 alt='수정' align=absmiddle></a>"; } ?>
<? if ($delete_href) { echo "<a href=\"$delete_href\"><img src='$board_skin/delete.gif' border=0 alt='삭제' align=absmiddle></a>"; } ?>
</td>
<td width=30% align=right>
<? if ($prev_href) { echo "<a href=\"$prev_href\" title=\"$prev_wr_subject\"><img src='$board_skin/prev.gif' border=0 alt='이전글' align=absmiddle></a>"; } ?>
<? if ($next_href) { echo "<a href=\"$next_href\" title=\"$next_wr_subject\"><img src='$board_skin/next.gif' border=0 alt='다음글' align=absmiddle></a>"; } ?>
</td>
</tr>
</table>
</td></tr></table>
for($i=1;$i<=4;$i++)
{
echo "<img src=./data/file/$board[bo_table]/$row[wr_file".$i."]>";
}
2번식으로 해도 에러 발생
<?
for($i=1; $i <= 3; $i++) {
echo "<img src=\"./data/file/".$board[bo_table]."/".$row[wr_file{$i}\]."\">";
}?>
Parse error: parse error, unexpected '"', expecting ']' in
gbview.skin.php 파일 입니다.
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
if (!$skin_no) $skin_no = "01";
?>
<link rel='stylesheet' href='<?=$board_skin?>/style<?=$skin_no?>.css' type='text/css'>
<table width='<?=$width?>' align=center border=0 cellpadding=0 cellspacing=0><tr><td>
<table width='100%' border=0 cellpadding=0 cellspacing=0>
<tr>
<td colspan=2 class=line></td>
</tr>
<tr class=ct>
<td><font color=#000000><b>
<? if ($is_category) echo "[$category_name] "; ?>
[우편번호 :
<?=$member[mb_zip1]?>
-
<?=$member[mb_zip2]?>
]
<?=$subject?>
</b></font></td>
<td align=right>
<?=$datetime?>
</td>
</tr>
<tr class=ct>
<td> <font color=#000000><b> 전화번호 :
<?=$member[mb_tel]?>
HP:
<?=$member[mb_hp]?>
이름 : <?=$name?>
</b></font></td>
<td align=right><span class=wview>
(<?=$ip?>)</span>
</td>
</tr>
<tr>
<td colspan=2 height=1 bgcolor=#D4CFC3></td>
</tr>
<tr>
<td colspan=2>
<table width=100% cellpadding=5>
<tr>
<td style='word-break:break-all;' class='lh' height=100>
<?
echo " <table width='700' border=0 cellpadding=0 cellspacing=0><tr>";
$row=$write;
for ($i=1; $i<=5; $i++) {
echo "<td>";
if ($file[$i][view]) { echo $file[$i][view];echo "$file1_[$i]";
echo "<img src=./data/file/$board[bo_table]/$row[wr_file".$i."]>";
}
if ($file[$i][source]) { echo "<span class=wview>Download</span> :
<a href='{$file[$i][href]}'>{$file[$i][source]} ({$file[$i][size]})</a>";}
echo "</td>";
}
echo "</td></tr></table>";
echo " <table width='700' border=0 cellpadding=0 cellspacing=0><tr>";
for ($i=6; $i<=10; $i++) {
echo "<td>";
if ($file[$i][view]) { echo $file[$i][view]; }
if ($file[$i][source]) { echo "<span class=wview>Download</span> :
<a href='{$file[$i][href]}'>{$file[$i][source]} ({$file[$i][size]})</a>";}
echo "</td>";
}
echo "</td></tr></table>";
?>
<p>
<?$row=$write;?>
<img src='./data/file/<?=$board[bo_table];?>/<?=$row[wr_file1];?>' width='100' align='center' style='border:1 solid #222222'>
</p></td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<? if ($is_comment) { ?>
<? if ($is_comment_write) { ?>
<!-- 코멘트 쓰기 -->
<table width=<?=$width?> align=center cellpadding=10 cellspacing=0 border=0 bgcolor=#F5F5F5>
<form name=fgbview method=post action='./?doc=bbs/gbupdate.php'>
<input type=hidden name=w value='c'>
<input type=hidden name=bo_table value='<?=$bo_table?>'>
<input type=hidden name=sselect value='<?=$sselect?>' >
<input type=hidden name=stext value='<?=$stext?>'>
<input type=hidden name=wr_id value='<?=$wr_id?>'>
<input type=hidden name=page value='<?=$page?>'>
<input type=hidden name=section value='<?=$section?>'>
<tr>
<td align=center>
<table width=100% cellpadding=0 cellspacing=0 bgcolor=#FFFFFF border=0>
<tr>
<td colspan=2 align=center>
<table width=98% cellpadding=0 cellspacing=0>
<tr>
<td>
<textarea name=wr_content style='width:100%; line-height:150%;' rows=5 required itemname='내용' class=textarea></textarea>
</td>
<td width=64>
<input type=image src='<?="$board_skin/btncomment.gif"?>' border=0 align=absmiddle>
</td>
</tr>
<tr>
<td colspan=2 height=5></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</form>
</table><br>
<? } // if ?>
<!-- 코멘트 내용 -->
<? for ($i=0; $i<count($list); $i++) { ?>
<a name='c<?=$list[$i][wr_id]?>'></a>
<table width=<?=$width?> border=0 align=center cellpadding=0 cellspacing=0>
<tr>
<td height=25> <?=$list[$i][name]?> (<?=$list[$i][ip]?>) <? if ($list[$i][is_del]) { echo "{$list[$i][del_href]}<img src='$board_skin/com_del.gif' border=0 align=absmiddle></a> "; } ?></td><td align=right><?=$list[$i][datetime]?> </td>
</tr>
<tr>
<td valign=top colspan=2>
<table width=100% cellpadding=7 cellspacing=0>
<tr>
<td class='comment'><?=$list[$i][content]?> </td>
</tr>
</table>
</td>
</tr>
<tr><td colspan=2 height=1 bgcolor=#DADADA></td></tr>
</table><br>
<? } // for ?>
<? } // if ?>
<!-- 링크 -->
<table width='100%' border=0 cellpadding=0 cellspacing=0>
<tr>
<td width=70% height=35>
<? if ($search_href) { echo "<a href=\"$search_href\"><img src='$board_skin/searchlist.gif' border=0 alt='검색목록' align=absmiddle></a>"; } ?>
<? echo "<a href=\"$list_href\"><img src='$board_skin/list.gif' border=0 alt='목록' align=absmiddle></a>"; ?>
<? if ($write_href) { echo "<a href=\"$write_href\"><img src='$board_skin/write.gif' border=0 alt='글쓰기' align=absmiddle></a>"; } ?>
<? if ($update_href) { echo "<a href=\"$update_href\"><img src='$board_skin/edit.gif' border=0 alt='수정' align=absmiddle></a>"; } ?>
<? if ($delete_href) { echo "<a href=\"$delete_href\"><img src='$board_skin/delete.gif' border=0 alt='삭제' align=absmiddle></a>"; } ?>
</td>
<td width=30% align=right>
<? if ($prev_href) { echo "<a href=\"$prev_href\" title=\"$prev_wr_subject\"><img src='$board_skin/prev.gif' border=0 alt='이전글' align=absmiddle></a>"; } ?>
<? if ($next_href) { echo "<a href=\"$next_href\" title=\"$next_wr_subject\"><img src='$board_skin/next.gif' border=0 alt='다음글' align=absmiddle></a>"; } ?>
</td>
</tr>
</table>
</td></tr></table>
댓글 전체