Jolsvi Posted June 18, 2021 Share Posted June 18, 2021 Hi, I have tried to browse some forum about blank captcha image problem, but I haven't got solution yet. Please help, maybe someone have same issue and could share how to solve it. So I have product review module, and it has captcha feature. But captcha code is not appearing. (attached 1) When I check the inspect element, it shows (attached 2 & 3): Notice: A non well formed numeric value encountered in /home/waterfj0/public_html/modules/homecomments/library/Captcha.php on line 76 var captcha_src = "https://waterfilterforfridge.com.au/index.php?fc=module&module=homecomments&controller=captcha&homecomments_captcha&t=0.48374300+1623974623"; I follow some forum and try to edit the line 76: // Use milliseconds instead of seconds srand(microtime() * 100); <--- line 76 - change to: srand(microtime(true) * 100); // Generate CAPTCHA code if not set by user if (empty($captcha_config['code'])) { $captcha_config['code'] = ''; $length = rand($captcha_config['min_length'],$captcha_config['max_length']); $captcha_code_length = Tools::strlen($captcha_config['code']); while ($captcha_code_length < $length) { $captcha_config['code'] .= Tools::substr( $captcha_config['characters'], rand() % (Tools::strlen($captcha_config['characters'])), 1 ); $captcha_code_length = Tools::strlen($captcha_config['code']); } } After I edit the line 76, the captcha is showing without image at all (attached 3) Currently the website is running under: Prestashop 1.6.1.4. PHP version 7.1 Thank you in advance Link to comment Share on other sites More sharing options...
SmartDataSoft Posted June 22, 2021 Share Posted June 22, 2021 @Jolsvi You need to enable the debug mode of your site and then need to check what is the erorr show. What is your php version and your PrestaShop version. If you are not expert in php coding. I suggest you to hire any professional who can do this task for you within few mins. Thank you Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now