상품 리스트 상단에 상품 카테고리가 뿌려지는데 예를들어 ca_id=4040 카테고리만 4040이 아닌 다른 페이지(임의의 페이지)로 연결하려면 아래 코드 수정해서 가능할까요?
4040 카테고리일경우 http://naver.com로 이동하게 하려면 어찌해야할까요~ 도움 부탁드립니다.
<?
$str = "";
$exists = false;
$depth2_ca_id = substr($ca_id, 0, 2);
$sql = " select ca_id, ca_name from $g4[yc4_category_table]
where ca_id like '${depth2_ca_id}%'
and length(ca_id) = 4
and ca_use = '1'
order by ca_id ";
$result = sql_query($sql);
while ($row=sql_fetch_array($result)) {
if (preg_match("/^$row[ca_id]/", $ca_id))
$span = "<span style='font-weight:bold;'>";
else
$span = "<span>";
$str .= "<a href='./list.php?ca_id=$row[ca_id]'><img src='$g4[path]/remon_img/cata_$row[ca_id].png' border='0' title='$row[ca_name]'></span></a> ";
$exists = true;
}
if ($exists) {
echo "
<table align=center cellpadding=0 cellspacing=0 width=930 height=43 background=$g4[path]/remon_img/catagory_bg.jpg>
<tr>
<td width=1221 align='center'>$str
</td>
</tr>
</table><br>";
}
?>
4040 카테고리일경우 http://naver.com로 이동하게 하려면 어찌해야할까요~ 도움 부탁드립니다.
<?
$str = "";
$exists = false;
$depth2_ca_id = substr($ca_id, 0, 2);
$sql = " select ca_id, ca_name from $g4[yc4_category_table]
where ca_id like '${depth2_ca_id}%'
and length(ca_id) = 4
and ca_use = '1'
order by ca_id ";
$result = sql_query($sql);
while ($row=sql_fetch_array($result)) {
if (preg_match("/^$row[ca_id]/", $ca_id))
$span = "<span style='font-weight:bold;'>";
else
$span = "<span>";
$str .= "<a href='./list.php?ca_id=$row[ca_id]'><img src='$g4[path]/remon_img/cata_$row[ca_id].png' border='0' title='$row[ca_name]'></span></a> ";
$exists = true;
}
if ($exists) {
echo "
<table align=center cellpadding=0 cellspacing=0 width=930 height=43 background=$g4[path]/remon_img/catagory_bg.jpg>
<tr>
<td width=1221 align='center'>$str
</td>
</tr>
</table><br>";
}
?>
댓글 4개
while ($row=sql_fetch_array($result)) {
if ($row[ca_id] == '4040') {
$str .= "<a href='http://naver.com/'>네이버</a> ";
}
else {
if (preg_match("/^$row[ca_id]/", $ca_id))
$span = "<span style='font-weight:bold;'>";
else
$span = "<span>";
$str .= "<a href='./list.php?ca_id=$row[ca_id]'><img src='$g4[path]/remon_img/cata_$row[ca_id].png' border='0' title='$row[ca_name]'></span></a> ";
}
$exists = true;
}
이런 코드 말씀이신가요?
if ($row[ca_id] == '4040') {
$str .= "<a href='http://naver.com/'>네이버</a> ";
}
else {
if (preg_match("/^$row[ca_id]/", $ca_id))
$span = "<span style='font-weight:bold;'>";
else
$span = "<span>";
$str .= "<a href='./list.php?ca_id=$row[ca_id]'><img src='$g4[path]/remon_img/cata_$row[ca_id].png' border='0' title='$row[ca_name]'></span></a> ";
}
$exists = true;
}
이런 코드 말씀이신가요?
게시글 목록
| 번호 | 제목 |
|---|---|
| 56073 | |
| 56067 | |
| 56065 | |
| 56060 | |
| 56058 | |
| 56055 | |
| 56051 | |
| 56048 | |
| 56044 | |
| 56043 | |
| 56042 | |
| 56039 | |
| 56035 | |
| 56032 | |
| 56030 | |
| 56028 | |
| 56025 | |
| 56018 | |
| 56012 | |
| 56010 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기