메인타입에 장바구니 버튼 넣기

메인타입에 장바구니 버튼 넣기

QA

메인타입에 장바구니 버튼 넣기

본문

이렇게 수정해봤는데 페이지를 찾을수 없다고 나오네요.
어떻게 수저해야 하는지요
===================================================================================================
 <?
$btn_img = "<img src='$g4[shop_img_path]/btn_cart_in.gif' border=0 alt='장바구니 담기'>";
{
    // 옵션이 있는 상품은 선택할 수 없음
    if (preg_match("/;|\\r/", trim($row['it_opt1']).trim($row['it_opt2']).trim($row['it_opt3']).trim($row['it_opt4']).trim($row['it_opt5']).trim($row['it_opt6']))) {
        $onclick_str = "옵션이 있는 상품이므로 바로 장바구니에 담을 수 없습니다.";
    }
    echo "
    <form name='flistskin7_$i' method='post' action='<?=$g4[shop_path]?>/cartupdate.php'>
    <input type='hidden' name='sw_direct' value='0'>
    <input type='hidden' name='it_id' value='$row[it_id]'>
    <input type='hidden' name='it_name' value='".stripslashes($row[it_name])."'>
    <input type='hidden' name='it_amount' value='$it_amount'>
    <input type='hidden' name='it_point' value='$row[it_point]'>
    <input type='hidden' name='ct_qty' value='1'> ";
    if (!$row['it_gallery']) {
        if ($onclick_str)
            echo "<a href=\"javascript:alert('$onclick_str'); location.href='<?=$g4[shop_path]?>/item.php?it_id=$row[it_id]';\">$btn_img</a>";
        else
            echo "<a href=\"javascript:document.flistskin7_$i.submit();\">$btn_img</a></form>";
 } }
?>
 
 
 
 
 
====================================================================================================
이것은 리스트타입  원본소스
==============================================================================================================

<table width=100% cellpadding=4 cellspacing=1>
<?
$btn_img = "<img src='$g4[shop_img_path]/btn_cart_in.gif' border=0 alt='장바구니 담기'>";
for ($i=0; $row=sql_fetch_array($result); $i++)
{
    // 옵션이 있는 상품은 선택할 수 없음
    if (preg_match("/;|\\r/", trim($row['it_opt1']).trim($row['it_opt2']).trim($row['it_opt3']).trim($row['it_opt4']).trim($row['it_opt5']).trim($row['it_opt6']))) {
        $onclick_str = "옵션이 있는 상품이므로 바로 장바구니에 담을 수 없습니다.";
    }
    $it_amount = get_amount($row);
    echo "
    <form name='flistskin7_$i' method='post' action='./cartupdate.php'>
    <input type='hidden' name='sw_direct' value='0'>
    <input type='hidden' name='it_id' value='$row[it_id]'>
    <input type='hidden' name='it_name' value='".stripslashes($row[it_name])."'>
    <input type='hidden' name='it_amount' value='$it_amount'>
    <input type='hidden' name='it_point' value='$row[it_point]'>
    <input type='hidden' name='ct_qty' value='1'>
    <tr>
        <td>
            <table width=100% cellpadding=0 cellspacing=0>
            <tr>
                <td width='".($img_width+20)."' align=center>".get_it_image($row[it_id]."_s", $img_width , $img_height, $row[it_id])."</td>
                <td>
                    <a href='./item.php?it_id=$row[it_id]' class=item>".it_name_icon($row)."</a><br>
                    ".get_text($row['it_basic'])."
                </td>
            </tr>
            </table>
        </td>
        <td align=center>$row[it_maker]</td>
        <td align=right>";
    echo "<td align=center>";
    if (!$row['it_gallery']) {
        if ($onclick_str)
            echo "<a href=\"javascript:alert('$onclick_str'); location.href='./item.php?it_id=$row[it_id]';\">$btn_img</a>";
        else
            echo "<a href=\"javascript:document.flistskin7_$i.submit();\">$btn_img</a>";
    }
    echo "</td></tr></form>";
}
if ($i == 0)
    echo "<tr><td colspan=5 align=center><span class=point>자료가 한건도 없습니다.</span></td></tr>\n";
?>
<tr><td colspan=5 background='<?="$g4[shop_img_path]/line_h.gif"?>' height=1></td></tr>
</table>

이 질문에 댓글 쓰기 :

답변 2

 <form name='flistskin7_$i' method='post' action='<?=$g4[shop_path]?>/cartupdate.php'>

이부분이 잘못 되셧네요.

php문 echo로 감싸져 있는데 <?=$g4[shop_path]?>이부분을 $g4[shop_path] 이렇게 변경하셔야 됩니다.

 <form name='flistskin7_$i' method='post' action='$g4[shop_path]/cartupdate.php'>이런식으로요

해결되셧으면 좋겠네요.

답변을 작성하시기 전에 로그인 해주세요.
전체 16
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT