테스트 사이트 - 개발 중인 베타 버전입니다

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

stics 6년 전 조회 2,015

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

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

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

이렇게 나오게 되는데요,

 

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

 

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

 

 

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

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

 

</p>

<p><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"></p>

<p><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"><?}?></p>

<p>

댓글을 작성하려면 로그인이 필요합니다.

답변 1개

채택된 답변
+20 포인트
e
6년 전

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

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

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

로그인 후 평가할 수 있습니다

답변에 대한 댓글 2개

s
stics
6년 전
해당 부분을 추가해도 주소상에는 아무런 변화가 없네요 ㅠ
e
eyekiss
6년 전
주소로 넘어가는 것은 get 방식이구요.
이건 post 방식으로 넘기는 겁니다.
method="post"

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

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인