Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Captcha Validation


Cntl_Alt_Del

Recommended Posts

I am doing my captcha validation at the create_account.php and so far, i had managed to get the image appearing everytime i refresh my screen. Now my main problem is that I am unable to do the validation even though i had key in the correct security code.

 

Below are my codes in create_account.php:

 

<?php

 

function tep_validate_captcha($security_code) {

session_start();

if( isset($_POST['security_code']))

{

if( !empty($_SESSION['security_code'] ) && $_SESSION['security_code'] == $_POST['security_code'] )

{

return TRUE;

}

else

{

return FALSE;

}

 

}

else

{

return FALSE;

}

unset($_SESSION['security_code']);

}

?>

 

 

My code in detecting whether the user key in the correct code or not.

 

if (tep_validate_captcha($security_code) == false){

 

$error = true;

 

$messageStack->add('create_account', ENTRY_SECURITY_CODE_ERROR);

 

}

 

 

And below is my textbox and how i make the captcha image appear using CaptchaSecurityImages.php

 

<tr>

<td class="main"><?php echo ENTRY_SECURITY_CODE; ?></td>

<td class="main"><?php echo tep_draw_password_field('security_code') . ' ' . (tep_not_null(ENTRY_SECURITY_CODE_TEXT) ? '<span class="inputRequirement">' . ENTRY_PASSWORD_CONFIRMATION_TEXT . '</span>': ''); ?></td>

</tr>

 

<tr>

<td class="main"><?php ?></td>

<td class="main"><img src="CaptchaSecurityImages.php?width=100&height=40&characters=5" /></td>

</tr>

 

 

Anyone can assist?

 

Thanks

CAD

Link to comment
Share on other sites

<td class="main"><?php ?></td>

<td class="main"><img src="CaptchaSecurityImages.php?width=100&height=40&characters=5" /></td>

the picture code and above verification will be different and never the same.

Please read this line: Do you want to find all the answers to your questions? click here. As for contribution database it's located here!

8 people out of 10 don't bother to read installation manuals. I can recommend: if you can't read the installation manual, don't bother to install any contribution yourself.

Before installing contribution or editing/updating/deleting any files, do the full backup, it will save to you & everyone here on the forum time to fix your issues.

Any issues with oscommerce, I am here to help you.

Link to comment
Share on other sites

<tr>

<td class="main"><?php echo ENTRY_SECURITY_CODE; ?></td>

<td class="main"><?php echo tep_draw_password_field('security_code') . ' ' . (tep_not_null(ENTRY_SECURITY_CODE_TEXT) ? '<span class="inputRequirement">' . ENTRY_PASSWORD_CONFIRMATION_TEXT . '</span>': ''); ?></td>

</tr>

 

<tr>

<td class="main"><?php ?></td>

<td class="main"><img src="CaptchaSecurityImages.php?width=100&height=40&characters=5" /></td>

</tr>

 

Thanks,

 

Regards

 

web hosting domain

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...