I have a basic form that I need to run PHP from, I am not sure how to get the PHP to acknowledge the checkboxes aren’t checked, it returns a “invalid index”. Thanks in advance.
<!DOCTYPE html>
<!-- batteries.php -->
<html lang = "en">
<head>
<title>Execute the batteries.html </title>
<meta charset = "utf-8" />
<style type = 'text/css"
td, th, table {border: thin solid black;}
</style>
</head>
<body>
<?php
//get form values
$aa4 = $_POST["aa4"];
$aa8 = $_POST["aa8"];
$d4 = $_POST["d4"];
$d8 = $_POST["d8"];
$fname = $_POST["fname"];
$lname = $_POST["lname"];
$payment = $_POST[payment];
//compute costs
$aa4_cost = 4.39 * $aa4;
$aa8_cost = 7.29 * $aa8;
$d4_cost = 5.95 * $d4;
$d8_cost = 9.49 * $d8;
$tax_cost = .063;
$subtotal = $aa4_cost + $aa8_cost + $d4_cost + $d8_cost;
$include_tax = $subtotal * .063;
$total_cost = $subtotal + $include_tax;
$total_items = $aa4 + $aa8 + $d4 + $d8;
//Return results to browser
?>
<h4> Customer: </h4>
<?php
print ("$fname <br /> $lname <br />");
?>
<p /> <p />
<table>
<caption> Order Information </caption>
<tr>
<th> Product </th>
<th> Price </th>
</tr>
<tr>
<td> Four AA Batteries </td>
<td> $4.39 </td>
<td> <?php print ("aa4"); ?> </td>
<td> <?php printf ("$ %4.2f", $aa4_cost); ?> </td>
</tr>
<tr>
<td> Eight AA Batteries </td>