-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathradio_btn.php
43 lines (37 loc) · 1.07 KB
/
radio_btn.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<form action="index.php" method="post">
<input type="radio" name="credit_card" value="Visa">Visa<br>
<input type="radio" name="credit_card" value="Visa">Master card<br>
<input type="radio" name="credit_card" value="Visa">American express<br>
<input type="submit" name = "confirm" value="confirm"><br>
</form>
</body>
</html>
<?php
if(isset($_POST["confirm"])){
$credit_card = null;
if(isset($_POST["credit_card"])){
$credit_card = $_POST["credit_card"];
echo $credit_card;
}
if($credit_card == "Visa"){
echo"You selected Visa";
}
elseif($credit_card == "Master card"){
echo"You selected Master card";
}
elseif($credit_card == "American express"){
echo"You selected American express";
}
else{
echo"Please make a selection";
}
}
?>