I am getting
header may not contain more than a single header, new line detected
somewhere from the following header calls but makes absolutely no sense to me... Anything I've missed?
// IF wristband is not assigned to attendee
if ($wristassoc['attendid'] == '') {
// IF attendee does not have a wristband assigned
if ($attendwrist1['wristband'] == '') {
header("Location: updateform.php?result=6&attendid=".$attendid."&wristband=".$wristband."");// Enter PIN to assign
} else {
// IF attendee has a wristband, is it this one?
if ($attendwrist1['wristband'] == $wristband) {
header("Location: wristbandassignform.php?result=5&wristband=".$wristband." ");//Wristband already assigned to attendee
} else {
header("Location: updateform.php?result=4&attendid=".$attendid."&wristband=".$wristband.""); // Are you sure you want to update?
}
}
} else {
// IF wristband is assigned to this attendee, IF not, wristband assigned to someone else, duplicate possible
if ($wristassoc['attendid'] == $attendid) {
header("Location: wristbandassignform.php?result=9&wristband=".$wristband."");//Wristband already assigned to attendee
} else {
header("Location: wristbandassignform.php?result=6");//Duplicate Possible
}
}
The variable $attendid or $wristband probably contains a newline character. Try var_dump()/print_r() on these variables to show their content.
Try if statement with isset()
function like :
if (isset($wristassoc['attendid']) && !empty($wristassoc['attendid'])) {
// IF attendee does not have a wristband assigned
if (isset($attendwrist1['wristband']) && !empty($attendwrist1['wristband'])) {
header("Location: updateform.php?result=6&attendid=" . $attendid . "&wristband=" . $wristband . ""); // Enter PIN to assign
} else {
// IF attendee has a wristband, is it this one?
if (isset($attendwrist1['wristband']) == $wristband) {
header("Location: wristbandassignform.php?result=5&wristband=" . $wristband . " "); //Wristband already assigned to attendee
} else {
header("Location: updateform.php?result=4&attendid=" . $attendid . "&wristband=" . $wristband . ""); // Are you sure you want to update?
}
}
} else {
// IF wristband is assigned to this attendee, IF not, wristband assigned to someone else, duplicate possible
if (isset($wristassoc['attendid']) == $attendid) {
header("Location: wristbandassignform.php?result=9&wristband=" . $wristband . ""); //Wristband already assigned to attendee
} else {
header("Location: wristbandassignform.php?result=6"); //Duplicate Possible`
}
}