survey_seahorse

Software Engineering Project - Fall 2018
Log | Files | Refs | README

questions.php (720B)


      1 <html>
      2 <?php
      3 include_once 'res/session.php';
      4 include 'res/navbar.php';
      5 
      6 echo '<link rel="stylesheet" href="res/style.css">';
      7 echo '<h2> Enter the questions for your survey </h2>';
      8 
      9 if (isset($_SESSION['questions'])) {
     10     $questions = $_SESSION['questions'];
     11     echo "<form class='question-form' method = 'POST' action = 'res/submit-questions.php'>";
     12     for($counter = 0; $counter < $questions; $counter++) {
     13         $questionNum = $counter + 1;
     14         echo "<input type = 'text' name = 'questions[]' class = 'questions' placeholder='Question $questionNum' /><br/>";
     15     }
     16     echo "<input type = 'submit' value = 'SEND'/>";
     17     echo "</form>";
     18 } else {
     19     header("Location: res/nope.php");
     20     exit();
     21 }
     22 ?>
     23 </html>