PHP: How do I have a variable hhtp-header value for my GET request?
- by Cortopasta
I want the user to submit an answer to a question, then upon submission be redirected back to the page where they asked the question and I can't seem to get this to work:
if (!isset($_POST['answer']) && !isset($_POST['verse']))
{
echo "Please fill out form.";
}
elseif (!isset($_POST['answer']) || !isset($_POST['verse']))
{
echo "one field left blank";
}
else
{
$user->submitAnswer($question_id);
header("Location: welcome.php?question_id=$question_id");
exit;
}
What am I doing wrong?
EDIT: Sorry, wasn't very clear. I'm trying to pass the variable $question_id to the header(location: part so that it will pull up the question they were just on and show the answer they posted