form의 값 submit - DB저장 후 다시 원래 페이지 돌아와서 리스트 재 출력
본문
안녕하세요.
1.php form의 값을 post로 2.php 에서 sql insert를 한 뒤에
다시 원래의 1.php에서 보여주던 sql select / list에 방금 등록된 내역까지 해서 새로 고침을 하려고하는데
DB는 저장이 되는데 2.php에서 힌화면에서 멈추고 다시 돌아오지도 않고, 뒤로가기 했을 시 바로 반영되지 않아서 새로 페이지로 들어와야지만 DB리스트가 보입니다.
혹시 어느 부분을 수정해야 하나요?
goto함수를 써볼까도 하는데 적용 방법을 모르겠습니다.
아래는 코드 예시 입니다.
2.php
<?php header("Content-Type:text/html;charset=utf-8");
include_once('./_common.php');
date_default_timezone_set('Asia/Seoul');
$sql =" insert into gp_withdrawal
(mb_id,gw_group,gw_amount,mchtId,gw_agency,gw_datetime)
VALUES
('$mb_id','$gw_group','$gw_amount','$mb_2','$mb_3','".G5_TIME_YMDHIS."') ";
sql_query($sql);
die();
$redirect_url = G5_HTTP_BBS_URL."/gp_withdrawal.php";
?>
답변 1
2.php
<?php header("Content-Type:text/html;charset=utf-8");
include_once('./_common.php');
date_default_timezone_set('Asia/Seoul');
$sql =" insert into gp_withdrawal
(mb_id,gw_group,gw_amount,mchtId,gw_agency,gw_datetime)
VALUES
('$mb_id','$gw_group','$gw_amount','$mb_2','$mb_3','".G5_TIME_YMDHIS."') ";
sql_query($sql);
//die(); //요거때문에 멈추는겁니다.
$redirect_url = G5_HTTP_BBS_URL."/gp_withdrawal.php";
?>
<script>
location.replace('<?=$redirect_url ?>');
</script>
$redirect_url 에 이동하고싶은 URL 적으시면됩니다.
!-->
답변을 작성하시기 전에 로그인 해주세요.