How do I properly write a conditional statement where if A is true, then do B AND C, else do D and E.
if (empty($A)) { B=0 AND C=0; }
else {D=X AND E=Y; }
in general, does that look right?
Here’s my actual code:
if (empty($_FILES['file']['name'])) {
$filelink = '' AND $filetext = '';
} else {
$filelink = mysql_real_escape_string($location) AND
$filetext = 'Open File';
}
That’s what the braces are for; they create a block. Whatever is in that block will execute. You can put as many statements as you want within the same block: