게시판 즐겨찾기
편집
드래그 앤 드롭으로
즐겨찾기 아이콘 위치 수정이 가능합니다.
PHP 이전 페이지 가기 질문 드립니다!!
게시물ID : programmer_21846짧은주소 복사하기
작성자 : Benny
추천 : 0
조회수 : 478회
댓글수 : 1개
등록시간 : 2017/12/09 01:02:11
옵션
  • 창작글
  • 베스트금지
  • 베오베금지
  • 본인삭제금지
  • 외부펌금지
안녕하세요~!!
기본 PHP 질문 드립니다. 설문조사 폼입니다. 지금 올린 코드는 두번째 .php  페이지 이구요.
두번째 페이지 하단에 "previous" 버튼과 "next" 버튼을 만들어서 "previous" 버튼을 눌렀을시 이전 페이지로 넘어가는 코드를 어떻게
집어 넣어야 할지 모르겠네요 ㅠㅠ php 를 이용해서 이전 페이지로 가는걸 하고 싶습니다.

<?php
// session starts here
    session_start();
?>

<html>
<head>
    <title>Multi-page Survey Application</title>
    <!--<link rel="stylesheet" href="style.css" />-->
</head>
<body>
    <h3>Please enter your name and age!</h3>
<?php
    if ($_SERVER['REQUEST_METHOD'] == 'POST') {
        if (isset($_SESSION['part']) && ($_SESSION['part'] == 1)) {
            if (isset($_POST['fullName'])) {
                $_SESSION['fullName'] = $_POST['fullName'];
            }
            if (isset($_POST['age'])) {
                $_SESSION['age'] = $_POST['age'];
            }
            if (isset($_POST['student'])) {
                $_SESSION['student'] = $_POST['student'];
            }
            $_SESSION['part'] = 2;
            form_2();
        }
    } else {
            $_SESSION['part'] = 1;
            form_1();
    }
?>

    <form method="POST" action="./question2.php">
        <div for="fullName">
        <label for="fullName">Full Name:</label>
        <input type="text" id="fullName" name="fullName" value="" placeholder="Your Name" tabindex="1" autofocus="autofocus"></input>
        </div><br>
        <div for="age">
        <label for="age">Your Age:</label>
        <input type="text" id="age" name="age" value="" placeholder="Your Age" tabindex="2" autofocus="autofocus"></input>
        </div><br>
        <div for="student">
        <label for="student">Are you a student?</label>
        <select name="student">
            <option value=""></option>
            <option value="fullTime">Yes, Full Time</option>
            <option value="partTime">Yes, Part Time</option>
            <option value="noStudent">No</option>
          </select>
          <br><br>
          <input type="submit" value="previous" />
          <input type="submit" value="next" />
      </form>
</body>
</html>
전체 추천리스트 보기
새로운 댓글이 없습니다.
새로운 댓글 확인하기
글쓰기
◀뒤로가기
PC버전
맨위로▲
공지 운영 자료창고 청소년보호