i am using the following code:
if ($this->FileSD->Upload->FileSize > 0) {
$rsnew["FileSD"] = "$rname $docpath1 $docpath2 " . " " . "$docpath SD-ID$docid" . ".$ext3";
return TRUE;
}
else {
$rnew["FileSD"] = "$rname $docpath1 $docpath2 " . " " . "$docpath SD-ID$docid" . ".$ext4";
return TRUE;
}
if ($this->File->Upload->FileSize > 0) {
$rsnew["File"] = "$rname $docpath1 $docpath2 " . " " . "$docpath FD-ID$docid" . ".$ext";
return TRUE;
}
else {
$rnew["File"] = "$rname $docpath1 $docpath2 " . " " . "$docpath FD-ID$docid" . ".$ext1";
return TRUE;
}
this make a reference to field on my form, (Field and FieldSD) the problem is the if condition it is only working on the top field that appear on the code, and not on the second one, if i move the code of position, only work the first part of the statement.
Is there any solution for this?
Final Code was as:
`if ($this->FileSD->Upload->FileSize > 0) { $rsnew["FileSD"] = "$rname $docpath1 $docpath2 " . " " . "$docpath SD-ID$docid" . ".$ext3";
} else { $rnew["FileSD"] = "$rname $docpath1 $docpath2 " . " " . "$docpath SD-ID$docid" . ".$ext4";
}
if ($this->File->Upload->FileSize > 0) { $rsnew["File"] = "$rname $docpath1 $docpath2 " . " " . "$docpath FD-ID$docid" . ".$ext";
} else { $rnew["File"] = "$rname $docpath1 $docpath2 " . " " . "$docpath FD-ID$docid" . ".$ext1";
} return TRUE;
}`
Aucun commentaire:
Enregistrer un commentaire