Hello, I am having a little trouble getting the variable $total to insert into mysql table. I used javascript to get the total that is in the input box. Any help is very much appreciative.
Here is site:
http://illcomputers.comyr.com/custom.php
Thank You
Snippets of Code
JavaScript Code
var mainitems = datacost + dvdcost + keymouse + flpycost + pwrcost + mntrcost + speakerCost + Case;
var lowitems = cpule + memle + videole + soundle + boardle + osle;
var total = mainitems + lowitems;
document.getElementById("amt1").value = total.toFixed(2);
HTML Code
<td><input name="amt1" id="amt1" type="text" readonly /></td>
<td><input name="amt2" id="amt2" type="text" readonly /></td>
<td><input name="amt3" id="amt3" type="text" readonly /></td>
PHP Code
$total = $_POST['amt1'];
echo "Total Cost: ".$total."<br />";
$query = "INSERT INTO illumcomputers (price) VALUES ('$total')";
$result = mysqli_query($dbc, $query)
or die ('Error querying database.');