Hi, im alittle late in the game here, i finally saw that 1.4 support is shut down and im in the process of moving my data over to the new version. And when i was finishished i wanted to share this with everyone but i cant get it to work on 1.5 and not sure why
Its not taking my user input into the form, the session answer is there i did an echo and the value is that, but its not grabbing the value of my answer when i click send an im not sure if i need to add the form key to the cage check or not... can you point me in the right directions. is all post data sent thru a special filter in order to accept it..
here is the code, im not asking for you to do code for me just help me understand where im missing the boat here... thanks
first here is the form data funciton i added to the top of register php
/**
* display_security()
*
* Display the security question
*
**/
// added this function for security question
//security answer
$_SESSION['correct_answer'] = "5";
//display security question
function display_security()
{
global $CPG_PHP_SELF,$lang_register_php;
$sectext = "Please enter answer to security question";
echo <<<EOT
<center><em> STEP 1 - ANSWER SECURITY QUESTION </em>
<br />
<br />
<form method="post" action="$CPG_PHP_SELF">
EOT;
starttable(-1,$sectext);
echo <<<EOT
<!-- added new sec check here -->
<tr>
<td colspan="2" align="center" class="tablef">
Security Question: How many letter e's in the word "SecurityIntellegence"? <input name="response" type="text" class="textinput" id="response" size="1" maxlength="2" value="" />
<!-- stop new security check -->
<input type="submit" name="submit" id="submit" value="submit" class="button" />
</td>
</tr>
EOT;
endtable();
print '</form>';
//end of add
}//end display security
and here is the bottom of register php where i process the page process.. as you can see i just took the else that was there already and just added to it and included my process.
} else {
pageheader($lang_register_php['page_title']);
//added security
// tried this didnt work if ($superCage->post->keyExists('answer'))
if(isset($_POST['submit']))
{
$Sec_answer = getEscaped($_POST['response']);
if($Sec_answer != $_SESSION['correct_answer'])
{
$Incorrect = "<center><span style='font-size:10px;'>Security Question Answer is incorrect!! <br />
Please click register from main menu and try again!</span></center>";
starttable(-1,$Incorrect);
endtable();
}else{
pageheader($lang_register_php['page_title']);
if ($CONFIG['user_registration_disclaimer'] == 1 && !$superCage->post->keyExists('submit') && !$superCage->post->keyExists('agree'))
{
// display the disclaimer page
display_disclaimer();
} else {
if (!$superCage->post->keyExists('submit'))
{
input_user_info();
} else {
if (!check_user_info($errors))
{
input_user_info($errors);
}
}//close else
}//close else
}//close else if correct answer ok
} // close if post response
else{
// trap display security until corrrect answer given
display_security();
}
}//close else
pagefooter();
?>
i think this would be nice to share but i wanted to get it working first..