form 관련 질문입니다.

매출이 오르면 내리는 수수료! 지금 수수료센터에서 전자결제(PG)수수료 비교견적 신청해 보세요!
form 관련 질문입니다.

QA

form 관련 질문입니다.

답변 3

본문

page1.php


<!doctype html>
<html>
    <head>
        <meta charset="utf-8">
        <title>Form Test</title>
    </head>
    <body>
        <form name="ftest" id="ftest" action="./page2.php">
            <input type="text" name="f_attr1">
            <iframe src="./form.html">Loading...</iframe>
            <input type="submit" value="asdf">
        </form>
    </body>
</html>

 

form.html


<!doctype html>
<html>
    <head>
        <meta charset="utf-8">
    </head>
    <body>
        <input type="text" name="f_attr2">
    </body>
</html>

 

위와 같이 구성했을때, page1.php에서 폼을 제출하면 page2.php로 갔을때 f_attr2 변수가 포함되도록 할 수 있나요?

이 질문에 댓글 쓰기 :

답변 3

form.html


<?php
$f_attr2 = $_REQUEST["f_attr2"];
?>

<!doctype html>
<html>
    <head>
        <meta charset="utf-8">
    </head>
    <body>
        <input type="text" name="f_attr2" value="<?php echo $f_attr2; ?>">
    </body>
</html>

Form 이라는건 다른 페이지로 값을 전달하는거에요. 그렇게 전달하면 리퀘스트 , 겟, 포스트로 전달 받을 수 있다고 약속이 정해진거에요. 이건 그냥 규

칙이자 모두의 약속이에요.

답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 0
© SIRSOFT
현재 페이지 제일 처음으로