Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

help with my simple function code

Status
Not open for further replies.

tippytarka

Programmer
Jul 19, 2004
115
GB
can you see anything wrong in my code?

the first 'if' works and the second 'else if' works, but the third 'else' just seems to output the first 'if'... this is confusing me???

Code:
function email_verify($email_database,$email_input) {

	if ($email_database == "") {
		$email_none ="please register";
		return $email_none;
		
}	else if  ($email_database == $email_input) {
		$email_taken ='email already registered';
		return $email_taken;

}	else {
		echo 'thank you';
}
}


$email_database = $row['email'];
$email_input = $email;
$email_print = email_verify($email_database,$email_input);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top