So I'm tinkering with PHP, never really messed with it so forgive me if this is a very noob question. I've retrieved an old small website from a friend from a game server a few years ago. I'm playing around with it and noticed right off that the form to register an account is not submitting. I was hoping to get some help with what is going on here as I'm not sure I understand. I've never see if(isset($_POST before and I'm sort of familiar with else but this I cannot wrap my brain around. I'd also like to add that Question 1 through 5 are radio selections
$totalCorrect = 0;
if(isset($_POST['question-1-answers']))
{
$answer1 = $_POST['question-1-answers'];
$totalCorrect ++;
}
else
{
$answer1 = "";
}
if(isset($_POST['question-2-answers']))
{
$answer2 = $_POST['question-2-answers'];
$totalCorrect ++;
}
else
{
$answer2 = "";
}
if(isset($_POST['question-3-answers']))
{
$answer3 = $_POST['question-3-answers'];
$totalCorrect ++;
}
else
{
$answer3 = "";
}
if(isset($_POST['question-4-answers']))
{
$answer4 = $_POST['question-4-answers'];
$totalCorrect ++;
}
else
{
$answer4 = "";
}
if(isset($_POST['question-5-answers']))
{
$answer5 = $_POST['question-5-answers'];
$totalCorrect ++;
}
else
{
$answer5 = "";
}
if (strlen($_POST['story']) == 0)
{
$story = "";
}
else
{
$story = $_POST['story'];
$totalCorrect ++;
}
if (strlen($_POST['policy']) == 0)
{
$policy = "";
}
else
{
$policy = $_POST['policy'];
$totalCorrect ++;
}
if (strlen($_POST['terms']) == 0)
{
$terms = "";
}
else
{
$terms = $_POST['terms'];
$totalCorrect ++;
}
if (strlen($_POST['situation']) == 0)
{
$situation = "";
}
else
{
$situation = $_POST['situation'];
$totalCorrect ++;
}
if($totalCorrect == 9)
{
$_SESSION['question-1-answers'] = $answer1;
$_SESSION['question-2-answers'] = $answer2;
$_SESSION['question-3-answers'] = $answer3;
$_SESSION['question-4-answers'] = $answer4;
$_SESSION['question-5-answers'] = $answer5;
$_SESSION['story'] = $story;
$_SESSION['terms'] = $terms;
$_SESSION['situation'] = $situation;
$_SESSION['policy'] = $policy;
$registerstep = 2;
}
else {
array_push($errors, "<p style='color:red; text-align:center;'>You did not answer all of the questions!</p>");
}
}