Lukus
Lukus

Reputation: 1171

redirecting depending on mysql field value

I have 3 fields in mysql called colour1, colour2, colour3 with either a 'red' or 'blue' value. When attendance1 2 & 3 are submitted it saves in mysql then redirects to submitted1.html.

however if value for each field is 'no' I want it to redirect to submitted2.

Upvotes: 0

Views: 111

Answers (1)

James L.
James L.

Reputation: 4097

just add this above the last header

if($_POST['attendance1'] == 'no' && $_POST['attendance2'] == 'no' && $_POST['attendance3'] == 'no'){
    header("Location: otherpage.html");
    exit();
}

Upvotes: 1

Related Questions