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.
Not a member yet? Click here to register.
Forgot Password?

Image validation problem

Asked Modified Viewed 13,434 times
C
ChadMinter
C
  • Junior Member, joined since
  • Contributed 24 posts on the community forums.
  • Started 7 threads in the forums
  • Started this discussions
asked
Junior Member

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?
0 replies

20 posts

H
HobbyMan
H
Just some Guy
  • Veteran Member, joined since
  • Contributed 1,486 posts on the community forums.
  • Started 91 threads in the forums
answered
Veteran Member

You should also reload....

includes/captcha_include.php

0 replies
W
WEC
W
WEC 10
  • Veteran Member, joined since
  • Contributed 946 posts on the community forums.
  • Started 5 threads in the forums
answered
Veteran Member

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.
0 replies
C
ChadMinter
C
  • Junior Member, joined since
  • Contributed 24 posts on the community forums.
  • Started 7 threads in the forums
  • Started this discussions
answered
Junior Member

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!?!
0 replies
W
WEC
W
WEC 10
  • Veteran Member, joined since
  • Contributed 946 posts on the community forums.
  • Started 5 threads in the forums
answered
Veteran Member

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.
0 replies
C
ChadMinter
C
  • Junior Member, joined since
  • Contributed 24 posts on the community forums.
  • Started 7 threads in the forums
  • Started this discussions
answered
Junior Member

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?????
0 replies
W
WEC
W
WEC 10
  • Veteran Member, joined since
  • Contributed 946 posts on the community forums.
  • Started 5 threads in the forums
answered
Veteran Member

No typo there.

Did you try to disable you custom panels?
0 replies
C
ChadMinter
C
  • Junior Member, joined since
  • Contributed 24 posts on the community forums.
  • Started 7 threads in the forums
  • Started this discussions
answered
Junior Member

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.
0 replies
W
WEC
W
WEC 10
  • Veteran Member, joined since
  • Contributed 946 posts on the community forums.
  • Started 5 threads in the forums
answered
Veteran Member

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.
0 replies
C
ChadMinter
C
  • Junior Member, joined since
  • Contributed 24 posts on the community forums.
  • Started 7 threads in the forums
  • Started this discussions
answered
Junior Member

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
0 replies
C
ChadMinter
C
  • Junior Member, joined since
  • Contributed 24 posts on the community forums.
  • Started 7 threads in the forums
  • Started this discussions
answered
Junior Member

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.
0 replies
M
Matonor
M
Impossible things are there to be made possible
  • Veteran Member, joined since
  • Contributed 1,022 posts on the community forums.
  • Started 3 threads in the forums
answered
Veteran Member

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']);
Edited by Matonor on 01-05-2008 19:47,
0 replies
C
ChadMinter
C
  • Junior Member, joined since
  • Contributed 24 posts on the community forums.
  • Started 7 threads in the forums
  • Started this discussions
answered
Junior Member

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
0 replies
M
Matonor
M
Impossible things are there to be made possible
  • Veteran Member, joined since
  • Contributed 1,022 posts on the community forums.
  • Started 3 threads in the forums
answered
Veteran Member

forgot a second ) before the ; (above post updated)
0 replies
J
jak17
J
jak17 10
  • Member, joined since
  • Contributed 155 posts on the community forums.
  • Started 46 threads in the forums
answered
Member

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
0 replies
M
Matonor
M
Impossible things are there to be made possible
  • Veteran Member, joined since
  • Contributed 1,022 posts on the community forums.
  • Started 3 threads in the forums
answered
Veteran Member

try again. I added a fallback.
0 replies
C
ChadMinter
C
  • Junior Member, joined since
  • Contributed 24 posts on the community forums.
  • Started 7 threads in the forums
  • Started this discussions
answered
Junior Member

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
0 replies
J
jak17
J
jak17 10
  • Member, joined since
  • Contributed 155 posts on the community forums.
  • Started 46 threads in the forums
answered
Member

worked like a charm!

is there any particular reason why so many people started having this problem at once?
0 replies
S
shimari
S
  • Junior Member, joined since
  • Contributed 11 posts on the community forums.
  • Started 5 threads in the forums
answered
Junior Member

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.
0 replies
— 6 months later —
B
bikerbones
B
bikerbones 10
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.
  • Member, joined since
  • Contributed 55 posts on the community forums.
answered
Member

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
0 replies

Category Forum

Bugs and Errors - 6

Labels

None yet

Statistics

  • Views 0 views
  • Posts 20 posts
  • Votes 0 votes
  • Topic users 7 members

0 participants

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet