-
Notifications
You must be signed in to change notification settings - Fork 212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Output error #21
Comments
I also encountered this problem. Have you found a resolution? |
Need more info. Anything in the error log? Was that output copy and pasted? If so, the path seems wrong and the issue may be easier to identify. |
Is this problem resolved? I experience this problem too. |
The problem appears when I set array of parameters. When I use simple_php_captcha without parameters ($_SESSION['captcha'] = simple_php_captcha()) then everything is ok. Sorry for my english. |
The problem persists. I see a extra / before the path. I checked simple-php-captcha.php and on line 78 |
I think this is a bug in how the are generated in certain environments. A better approach might be to output a data URI to avoid paths altogether. |
That is how I fixed the bug by checking data URI output. Thanks for the simple php captcha. |
I am comparing this two things but it is not working sir any idea ? |
Sometimes when you use more than 7 characters for captcha code, generated captcha image become bigger than background image. Variable $text_pos_x_max at line 147 become negative and when you calculate variable $text_pos_x at line 148, mt_rand throw error. Line from error log: |
How to verify if the captcha image is equal with input So if in image is : 7m34z And user type: 7m34z , This is ok otherwise error! How to do this? |
@sticksoon This is shown here: http://labs.abeautifulsite.net/simple-php-captcha/ |
@claviska , I have try the following code:
So $captcha is the variable from which client what has post. But that code not work. |
The problem is in the crude way he is determining the relative path of "simple-php-captcha.php" when you include it and it is not located in the 'WEB_ROOT' but in a sub-directory, like '/captcha/simple-php-captcha.php'. The bug occurs if the following is not true, and you enter the else statement: I'm sure there is a more elegant way do this, but I feel lazy today so in 'simple-php-captcha.php' on line 77, change: This provides a path that doesn't end with an extra slash that strlen will count and remove. |
I also had problem with captcha not showing, but after I removed line simple-php-captcha:122, problem disappeared |
I have try the following code: |
After several hours of playing with this here's what I've found. First before doing anything I made the changes addressed here: If you have the script in a subfolder such as /captcha, the image will only display if you use the default settings. If you want to use your own settings you MUST spell out the different subdirectory in your settings, because the script while allowing for subfolders in the default settings, does not do so when compiling special settings. I followed the example within the script itself and used the following:
Now the image displayed as expected. Next I had the problem of every time I submitted the form with the correct captcha code, it would fail to validate because the action of submitting the form was causing the script to generate a completely new captcha which no longer matched the one I submitted. So I made the following change to the script. Changed to :: Now the captcha code is remembered no matter how many times the form is submitted and fails. It may not be the cleanest fix, but for the moment it's working for me. Hope this makes sense and helps answer some questions. |
If you have the script in a subfolder such as /captcha
in simple-php-captcha.php : |
The captcha does not show.
Output:
Array
(
[code] => 49cTm
[image_src] => /hp-captcha.php?_CAPTCHA&t=0.39992300+1464080100
)
Even when I change the file simple-php-captcha.php to force the proper output, the image won't load, so I guess there is another problem.
Please help
The text was updated successfully, but these errors were encountered: