form 관련 질문입니다.

form 관련 질문입니다.

QA

form 관련 질문입니다.

본문

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

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

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

회원로그인

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