I know I did sopmething wrong

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
me!
Forum Contributor
Posts: 133
Joined: Sat Nov 04, 2006 8:45 pm

I know I did sopmething wrong

Post by me! »

Ok this does not work... so what is the correct way to do it?

Code: Select all

// password checking
	if(trim("$password_a1") != ("$password_b1")) {
		$error_msg.="Your passwords do not match please re-enter them<br>";
		$error_9 = 'class="error"';
	} else {
		if (trim("$password_a1") < 4) {
		$error_msg.="Your password must be at least four letters<br>";
		$error_9 = 'class="error"';
	} else {
			if (trim("$password_a1") == ("$call_1")) {
			$error_msg.="Your passwords may NOT be your call sign!<br>";
			$error_9 = 'class="error"';
			}
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

define: "does not work"

and for starters, your missing a curly bracket at the end.. intending helps properly
me!
Forum Contributor
Posts: 133
Joined: Sat Nov 04, 2006 8:45 pm

Post by me! »

I di dit with this, and it seams to work

Code: Select all

if( trim("$password_a1") != ("$password_b1")) {
		$error_msg.="Your passwords do not match please re-enter them<br>";
		$error_9 = 'class="error"';
	} 
	elseif (trim("$password_a1") > 4) {
		$error_msg.="Your password must be at least four letters<br>";
		$error_9 = 'class="error"';
	} 
	elseif (trim("$password_a1") == ("$call_1")) {
			$error_msg.="Your passwords may NOT be your call sign!<br>";
			$error_9 = 'class="error"';
			}
nickvd
DevNet Resident
Posts: 1027
Joined: Thu Mar 10, 2005 5:27 pm
Location: Southern Ontario
Contact:

Post by nickvd »

Perhaps telling us what it's supposed to do would assist us in telling you why it's not doing it.

Without knowing what it's doing, we have no idea why/how/when/where... Get it?

Patient: Doctor, I'm broken, why?

Doctor: um... Why don't you tell me what is wrong, not that there IS something wrong...
Post Reply