Jump to content

Can't find Security Questions


rosscoD

Recommended Posts

Can someone tell me how I can display what question a user has selected as their security question? I know how to retrieve the securityqid but I cannot find the actual question in the database anywhere. Is the actual question encrypted? How can I display the question if I know the ID?

 

Thanks

Link to comment
Share on other sites

Try this:

$result = mysql_query("SELECT question,securityqans FROM tblclients,tbladminsecurityquestions WHERE tblclients.id=".$_SESSION["uid"]." AND tblclients.securityqid = tbladminsecurityquestions.id");
while($row = @mysql_fetch_array( $result )) {
 $question = decrypt($row['question']);
}
if (!$question) {
 echo 'No question set';
}else{
 echo $question;
}

Edited by robb3369
fixed query
Link to comment
Share on other sites

For some reason this did not work, I even hard coded the userID and this didn't show a question. No matter what 'no question set' was displayed.

 

Since I do all my own coding etc I just decided to hard code the question selections in an array and used securityqid to select the correct question from the array. Works as well with only one obvious drawback.

Link to comment
Share on other sites

You are running that query within the context of the whmcs system correct? I just re-verified the folliwng snippet of code by appending it to the bottom of the clientareadetails.tpl template and it worked like a champ:

{php}
$result = mysql_query("SELECT question,securityqans FROM tblclients,tbladminsecurityquestions WHERE tblclients.id=".$_SESSION["uid"]." AND tblclients.securityqid = tbladminsecurityquestions.id");
while($row = @mysql_fetch_array( $result )) {
 $question = decrypt($row['question']);
}
if (!$question) {
 echo 'No question set';
}else{
 echo $question;
}
{/php}

And just for a sanity check, does the whmcs admin page for the client (Clients Profile -> Profile Tab) show a security question set?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated