Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Sign In
Not a member yet? Click here to register.
Navigation

Image validation problem

Last updated on 12 years ago
C
ChadMinter
Posted 13 years ago
I posted this in the core forum but haven't had much luck. I guess I should have posted this here first.

After upgrading (which may or may not have had anything to do with it) I suddenly get the error

"Registration failed for the following reason(s):

Incorrect validation code.

Please Try Again"


when a user tries to register.

So far I've replaced register.php and maincore.php
For some reason fusion thinks that the image validation code does not match the one typed in.

When you load register.php in your browser it places an entry in fusion_captcha that does match the one displayed on the page (the numbers do match) but when you process the form it sees them differently. Perhaps there is a problem with the long string ?hash? associated with the code? I'm really tearing my hair out.

Here is the original post
http://php-fusion.co.uk/forum/viewthread.php?forum_id=38&thread_id=20750

the site is http://www.msgr.com

You are welcome to create (well try to create) an account yourself to see what the problem is.

I have a fresh maincore.php and register.php so its not in those two files.

Could it be a database problem? where does fusion get the random numbers that are displayed in the verification code?
HobbyManHobbyMan
Posted 13 years ago
You should also reload....

includes/captcha_include.php

Just some Guy
W
WEC
Posted 13 years ago
He already tried that even though not stated in this thread.

http://www.php-fusion.co.uk/forum/vie...d_id=20793

Chad, you should avoid splitting the same problem out in various different threads. Doesn't make it easier to keep track on what you already tried and which information you already provided.

If you are sure that your captcha table structure is correct, then you should upload fresh copies of the files already mentioned in various threads. Delete the files in question from your server before uploading, so that you are sure that fresh copies are really stored on the server.
C
ChadMinter
Posted 13 years ago
I'm sorry for cross posting but after posting it in the core forum and not getting any good replies, I though "oops, maybe I should have posted it in the bugs forum." I did so hoping that someone would see it that maybe didn't see it in the other one.

I also submitted a ticket to the help desk thing and haven't gotten a response.

Here is a rundown of what I have done:

1. replaced maincore.php
2. replaced register.php
3. replaced /includes/captcha_include.php
4. deleted the table fusion_captcha and rebuilt it by hand
5. deleted the table fusion_captcha and rebuilt it by running the code from the .12 update through a blank page
6. manually changed my version to .11 in the database so I could reapply all the upgrades (.12, .13, .14, .15)
7. deleting the entries out of fusion_captcha and fusion_newusers and starting with a fresh copy of register.php loaded into a browser.
8. tore hair out, cussed, stomped, cried, whined, and prayed

it just doesn't make sense

The really weird thing is that it will work one out of every 20 or so times randomly and not work any other time

If I load register.php into a browser and php myadmin into another browser I can look into fusion_captcha and see that both the captcha_code (the short digits) are the same, and the captcha_encode (the long strings) are the same but they aren't being seen as the same!?!
W
WEC
Posted 13 years ago
Try to disable all panels that didn't come with the core package.

If that makes the validation work, then enable your custom panels one by one and test registration.

The error may not be related to your upgrade, so think back on which other changes you may have made around the time when the validation stopped working.
C
ChadMinter
Posted 13 years ago
Question: Is this a typo in maincore.php or is it correct?

function check_captcha($captchs_encode, $captcha_string) {
if (preg_match("/^[0-9a-z]+$/", $captchs_encode) && preg_match("/^[0-9a-z]+$/", $captcha_string)) {
$result = dbquery("SELECT * FROM ".DB_PREFIX."captcha WHERE captcha_ip='".USER_IP."' AND captcha_encode='".$captchs_encode."' AND captcha_string='".$captcha_string."'");
if (dbrows($result)) {
$result = dbquery("DELETE FROM ".DB_PREFIX."captcha WHERE captcha_ip='".USER_IP."' AND captcha_encode='".$captchs_encode."' AND captcha_string='".$captcha_string."'");
return true;
} else {
return false;
}
} else {
return false;


should the $captchs in a couple of places there be $captcha?????
W
WEC
Posted 13 years ago
No typo there.

Did you try to disable you custom panels?
C
ChadMinter
Posted 13 years ago
Yes, I disabled them and it didn't help. I'm wondering if I reinstall fusion and use the same database prefix will it keep the current data in the tables and replace all the files? I've never been able to restore tables from a backup on this server so I'm a little leary about losing the data by doing a fresh install.
W
WEC
Posted 13 years ago
If you use the same database prefix, then you will lose all your data.

If you didn't modify any of the core files, then i would recommend that you make a backup of all files in your php-fusion installation and upload a fresh set of files.

Then restore config.php from your backup. I.e. don't run installation.

If that doesn't fix the problem then you need to look into database structure.
C
ChadMinter
Posted 13 years ago
OK, here is an updated "what I've tried"

1. replaced maincore.php
2. replaced register.php
3. replaced /includes/captcha_include.php
4. deleted the table fusion_captcha and rebuilt it by hand
5. deleted the table fusion_captcha and rebuilt it by running the code from the .12 update through a blank page
6. manually changed my version to .11 in the database so I could reapply all the upgrades (.12, .13, .14, .15)
7. deleting the entries out of fusion_captcha and fusion_newusers and starting with a fresh copy of register.php loaded into a browser.
8. backed up all my files, reuploaded a freshly downloaded copy of fusion(minus the blank_config and setup.php), chmodded the files mentioned in the installation readme, used the config.php from the backup -- and still got the error
9. renamed config.php to config.old and uploaded blank_config and setup.php and ran the setup program using a different database prefix to build a new db set. still got the error on the fresh installation.
10. switched the theme to a different theme (simplicity) and still got an error.
11. called tech support for hosting company and listened to a very static filled broken connection with some pakistani asking me what is php?
12. tore hair out, cussed, stomped, cried, whined, and prayed

it just doesn't make sense
C
ChadMinter
Posted 13 years ago
This is what echos at the top of the page:

SELECT * FROM fusion2_captcha WHERE captcha_ip='123.45.678.122' AND captcha_encode='' AND captcha_string=''

I changed the ip address to 123.45.678 becuase of what I'm about to tell you...

I don't know if this would have any effect, because it has alway been this way, but the user ip's on my site are always the same except for the last three digits. fusion never sees their real ip address for some strange reason every ip address will be 123.45.678.XXX where xxx changes with each registration. I have two other fusion websites on different servers and neither of them do that. They always use the users real ip address.
MatonorMatonor
Posted 13 years ago
you're host might use a load balancer or some kind of proxy-like device.
try replacing
define("USER_IP", $_SERVER['REMOTE_ADDR']);

in maincore.php by:
define("USER_IP", isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']);
Impossible things are there to be made possible
Edited by Matonor on 01-05-2008 18:47, 13 years ago
C
ChadMinter
Posted 13 years ago
Matanor, that gives me...

Parse error: parse error in /html/maincore.php on line 60

Warning: Cannot add header information - headers already sent by (output started at /html/maincore.php:60) in /html/subheader.php on line 12
MatonorMatonor
Posted 13 years ago
forgot a second ) before the ; (above post updated)
Impossible things are there to be made possible
J
jak17
Posted 13 years ago
ive been having the same problm for the past 3 days.

i did what u said matonor and now after filling in all the information and pressing register i get redirected to google.com
MatonorMatonor
Posted 13 years ago
try again. I added a fallback.
Impossible things are there to be made possible
C
ChadMinter
Posted 13 years ago
Matanor,

that fixed it! you are amazing, you are awesome, you are da man!

THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU
J
jak17
Posted 13 years ago
worked like a charm!

is there any particular reason why so many people started having this problem at once?
S
shimari
Posted 13 years ago
Hi folks,

I don't really understand much about PHP and a 16 year old set up my website for me. Recently I upgraded to MYSQL 5 and it changed the IP address of my database. My site actually went down because I didn't realize I had to change that address in my config.php file. It popped right back up once I changed the address, but ever since then the image validation code doesn't work at registration. If I change it to text it works, but I have had problems with spammers. I looked in my maincore.php file after reading this thread, but I couldn't find any references to the IP address of my database. Can anyone tell me where I need to change this info to make image registration work again?

Thanks so much, I appreciate you guys helping a clueless old guy.
B
bikerbones
Posted 12 years ago
I am having the same problem.

"Registration failed for the following reason(s):

Incorrect validation code.

Please Try Again"

The image doesn't match the sound code.

First time testing and it doesn't work.

I change the Validation code display method to text and it still shows an image.

If I set Display validation code to No, all functions fine, However, there is a reason why we all need validation.

Can anyone help me?

I don't know what to do.

Check it out for yourself.

http://www.bikers-n-outlaws.com/register.php
range'>Respects,
<-[BONES]->

www.bikers-n-outlaws.com/sig.gif
In case your curiosity gets the best of you, DO NOT come to my site and apply for membership if you are NOT a biker. You will most likely NOT be very welcome and your account will more than likely be deleted. No apologies, that is just the way things are these days.
You can view all discussion threads in this forum.
You cannot start a new discussion thread in this forum.
You cannot reply in this discussion thread.
You cannot start on a poll in this forum.
You cannot upload attachments in this forum.
You cannot download attachments in this forum.