Jump to content

Errors


jrws

Recommended Posts

Alright I guess, I didn't make it clear, I will try again :D

OK so what happens is that I have the $error array. This contains errors to display when something happens that I don't want to happen for example having a user enter blank info. The problem is these errors are now displaying even when there are no errors to display. I hope that clears it up.

Link to comment
https://forums.phpfreaks.com/topic/120492-errors/#findComment-621786
Share on other sites

I can see from your code:

if (!$user || !$disname || !$pass || !$passcon || !$email || !$emailcon) {

 

so if the case is:

if(0 or 1 or 1 or 1 or 0 or 1) = true
0 or 1 = 1
1 or 1 = 1
0 or 0 = 0

 

You want from that line to check if all the inputs are filled, so and AND logical operator is the right choice. If only one of the variables returns false, the whole expression becomes false. Modified with AND:

if (!$user && !$disname && !$pass && !$passcon && !$email && !$emailcon) {

 

For the problem you have, I can't seem to find any errors. Try to debug the code, checking if there is any misspelled variable, any misplaced if() statement (as you have many of them) and check what count($errors) give.

Link to comment
https://forums.phpfreaks.com/topic/120492-errors/#findComment-621817
Share on other sites

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.