I created a disclaimer page which includes a Accept/Decline buttons and a Submit button. I would like it so that when someone selects Accept and then Submit it goes to a particular URL1. But if they select Decline it goes to URL2. All the code is below. The current problem is that when I select Accept or Decline then click Submit, it doesn't do anything.
<!DOCTYPE html>
<html>
<head>
<title>Warning Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<?php
session_start();
if (isset($_POST['Accept'])) {
if ($_POST['Accept'] == 'Accept') {
$_SESSION['did_accept'] = true;
header ('Location: http://www.google.com');
die('<a href="http://www.google.com">Click here to continue</a>');
} else {
header ('Location: http://www.yahoo.com');
die('<a href="http://www.yahoo.com">Click here to continue</a>');
}
}
?>
</head>
<body>
<p>Some text</p>
<label>
<input type="radio" name="radio" value="Accept" id="Accept" onClick="Accept()">
Accept</label>
<br>
<label>
<input type="radio" name="radio" value="Decline" id="Decline" onClick="Decline()">
Decline</label>
<br>
<input type="submit" value="Submit">
</body>
</html>