I'm new to all this and I created a basic HTML document and tested it in the local server and it worked just fine. It allowed me to check my items that I wanted and hit order. From there it takes me to my PHP file that doesn't display a total. Can someone help and guide me on where I am going wrong?
My HTML doc has:
<html>
<body>
<body>
<h1><b>BOOK BARN<b></h1>
<h2>Select the book that you would like to purchase from the checkbox list.</h2>
<h3>For up coming books check the drop down list below.</h3>
//checkbox for available books
<form action="bookprocessorder2.php"method="get"/>
<input type="checkbox" name"choice[]"value="1"/>Stephen King Compilation,Price:10 USD<br/>
<input type="checkbox" name"choice[]"value="2"/>The Martian,Price:8 USD<br/>
<input type="checkbox" name"choice[]"value="3"/>Cat in the Hat,Price:4 USD<br/>
<input type="submit" value="Order"/>
</form>
//drop down
<td>Coming Soon:</td>
<td><select name="find">
<option value = "a">Runner</option>
<option value = "b">Gone Girl</option>
<option value = "c">The Book Thief</option>
</option>
</select>
</td>
</tr>
</body>
</html>
And my PHP file has:
<html>
<head>
</head>
<body>
<?php
echo '<b>Book Barn</b>';
echo '<p>Thank you for your purchase. Your order is as follows: </p>';
if(isset($_GET["choice"])){
$book=$_GET["choice"];
$c= count($book);
$price= 0.0;
for($i=0;$i<$c;$i++){
if($book[$i]==1){
$price=$price+10;
echo "You have selected Stephen King Compilation<br>";
}
if($book[$i]==2){
$price=$price+8;
echo "You have selected The Martian<br>";
}
if($book[$i]==3){
$price=$price+4;
echo "You have selected Cat in the Hat<br>";
}
}
echo "Price is: " .$price. "<br>";
}
?>
</body>
</html>
So why when I hit enter to go to the PHP document the only thing it returns is
"Book Barn
Thank you for your purchase. Your order is as follows: "