바로구매 클릭시 주소줄에 &type 을 추가하고 싶습니다.

바로구매 클릭시 주소줄에 &type 을 추가하고 싶습니다.

QA

바로구매 클릭시 주소줄에 &type 을 추가하고 싶습니다.

본문

상품 구매페이지에서 '바로구매' 버튼을 클릭했을 경우

주문서 작성페이지가 나옵니다.

이때 주소가 /shop/orderform.php?sw_direct=1

이렇게 나오게 되는데요,

 

이 뒤에 변수(?)를 하나 추가하려면 어떻게 해야할까요.

 

/shop/orderform.php?sw_direct=1&type=test 이런식으로 주소를 만들고 싶습니다.

 

 

** 모든 상품에서는 아니고 특정상품일때만 추가하고싶습니다.

아래와 같이 특정상품을 선택해주고 있습니다.

 


<form name="fitem" method="post" action="<?php echo $action_url; ?>" onsubmit="return fitem_submit(this);">
<input type="hidden" name="it_id[]" value="<?php echo $it_id; ?>">
<input type="hidden" name="sw_direct">
<input type="hidden" name="url">
<div style="width:850px;height:400px;position:absolute;margin:auto;left:0px;right:0px;top:0px;bottom:0px;">
<div style="width:850px;height:330px;position;relative;box-shadow:0px 0px 25px rgba(0,0,0,0.2);border-radius:10px;overflow:hidden;">
<?php if ($it_id == 1551656760) {?><input type="image" src="/img/m_pr_30.png" onclick="document.pressed=this.value;" id="sit_btn_buy" style="outline:none"><?}?>
<?php if ($it_id == 1551716255) {?><input type="image" src="/img/m_pr_60.png" onclick="document.pressed=this.value;" id="sit_btn_buy" style="outline:none"><?}?>
<?php if ($it_id == 1551717516) {?><input type="image" src="/img/m_pr_90.png" onclick="document.pressed=this.value;" id="sit_btn_buy" style="outline:none"><?}?>

이 질문에 댓글 쓰기 :

답변 1

아래와 같이 추가해주면 됩니다.

<input type="hidden" name="url">

<input type="hidden" name="type" value="test">

주소로 넘어가는 것은 get 방식이구요.
이건 post 방식으로 넘기는 겁니다.
method="post"

굳이 get 방식을 원하시면 아래와 같이 추가하면 되지만, 권장하지는 않습니다.
<form name="fitem" method="post" action="<?php echo $action_url; ?>&type=test" onsubmit="return fitem_submit(this);">

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

회원로그인

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