survey_seahorse

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

commit 01bcde0abf4de85424339264439a7485f488a4c7
parent b0306ef90d71f9907b5f5c4bfce925242a9539b6
Author: John Kubach <johnkubach@gmail.com>
Date:   Wed, 19 Dec 2018 14:33:46 -0500

question submission hotfix

fix error where only the last question would be submitted to the database

Diffstat:
Mwebsite/res/submit-questions.php | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/website/res/submit-questions.php b/website/res/submit-questions.php @@ -5,8 +5,8 @@ ini_set('session.cache_limiter','public'); session_cache_limiter(false); session_start(); include_once '../config.php'; -$questions = array(); +$questions = array(); $survey_id = $_SESSION['sid']; $questions = $_POST['questions']; @@ -21,6 +21,7 @@ for($counter = 0; $counter < sizeof($questions); $counter++) } for($counter = 0; $counter < sizeof($questions); $counter++){ + $q = $questions[$counter]; echo "Question #".($counter + 1).": ".$questions[$counter]."<br />"; $sql = "INSERT INTO question (survey_id, question_number, question_content) VALUES ('$survey_id', $counter + 1, '$q');";