In a form I have these two fields - file and file_new. Only one (hopefully) should contain a value. I have to determine which one has a value to determine which if statement to execute.
Below isn't working.
$file = mysql_real_escape_string($_POST['file']);
$file_new = mysql_real_escape_string($_POST['file_new']);
if ($file != '' AND $file_new == '') {
run this code
}
if ($file == '' AND $file_new != '') {
run this code
}
if ($file != '' AND $file_new != '') {
echo "Error - only one field can be filled in.";
}