RE: [PHP-WIN] I really don't understand this?

From: Date: Wed, 02 Apr 2003 08:20:07 +0000
Subject: RE: [PHP-WIN] I really don't understand this?
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-19246@lists.php.net to get a copy of this message
if (empty($form["name"])) { $error["name"] = "*"; $message["name"] = "Required field!"; } else if ($duplicate = duplicate_name($form["name"]) == "T") { // This seams to be an assignment of either true or false to duplicate(???) // e.g. $duplicate = (duplicate_name($form["name"]) == "T") // Hence $duplicate seams to be assign either true or false (1/0) and when you // do this will never trigger the rest of the mutual exclusions, since you // only check for weather $duplicate is "T" or "S". $error["name"] = "*"; $message["name"] = "Screen name already used!"; } else if ($duplicate == "D") { $error["name"] = "*"; $message["name"] = "Database error - Please try again in a few moments!"; } elseif ($duplicate == "S") { $error["name"] = "*"; $message["name"] = "Server error - Please try again in a few moments!"; } //Anders - as always totally ignorant about PHP syntax

« previous php.windows (#19246) next »