WOW! That's a lot of statements you've got there! The only "rule" to making statements would be that you're require to close just as many parantheses as you open.
With that in mind you can see that almost everybody would be very confused just looking at your statement. What you could do would be to break down each check (you've even grouped them already!) and then make one final check for them all, like this :
<?php
$name_ok = 1;
$username_ok = 1;
$password_ok = 1;
$hint_ok = 1;
if ( ($FirstName == '') or ($LastName == '') or ($xgender == '') ) {
name_ok = 0;
}
if ( ($Username == "" Or $Username == " ") or (ereg("[,.*+#']+",$Username) or (eregi($forbidden,$Username) or ($UNLenth < 3) and ($UNLenth > 0) ) {
$username_ok = 0;
}
if ( ($Password == "" or $Password == " ") or ($Password2 == "" or $Password2 == " ") or ($Password <> $Password2) or ($PWLenth < 6) ) {
$password_ok = 0;
}
if ( ($hintq == '') or ($hinta == '') or ($HALenth < 5 and $HALenth > 0) ) {
$hint_ok = 0;
)
// the final check
if ($name_ok && $username_ok && $password_ok && $hint_ok) {
// do something
} else {
// format('c:');
}
?>
That basically it ... again : You're doing a lot of check's at the same line which IS confusing and not easy to maintain later on. Try breaking down things first!