My PHP program doesn't run

FIRST FILE: index.php

<!DOCTYPE html>
<html>
<head>
<title>
Test program
</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>

<a href="http://www.nippondream.com\testitems\01a.mp3">Play the tape</a>

<form action="insert.php" method="POST">
Please choose the right answer!!!!

<table style="width: 20%">
<tr>
<th>Right <input type="radio" name="a" value="a" required/> </th>
<th>Light<input type="radio" name ="b" value="b" required/> </th>
<th>Can't tell<input type="radio" name ="c" value="c" required/> </th>
</tr>
</table>
<input type="submit" value="Enter"/>
</form>

</body>
</html>

 

********************

SECOND FILE: insert.php

<html>
<body>

<?php

$conn = mysqli_connect("localhost","root","","quizbank");
mysqli_query($conn, "SET NAMES 'UTF8'") or die("ERROR: ". mysqli_error($conn));

$sql="INSERT INTO users (user_id,item_id,response)
VALUES
('$_POST[a]','$_POST[b]','$_POST[c]') ";

if (!mysql_query($sql,$conn))
{
die('Error: ' . mysql_error());
}
echo "1 record added";
mysql_close($conn)

?>

</body>
</html>

Leave a Reply