Skip to content

Instantly share code, notes, and snippets.

@compil3
Created November 8, 2011 22:30
Show Gist options
  • Save compil3/1349502 to your computer and use it in GitHub Desktop.
Save compil3/1349502 to your computer and use it in GitHub Desktop.
<html>
<title>Confirmation</title>
<head></head>
<body>
<?php
$pnumber = $_POST["pnumber"];
$vend = $_POST['vend'];
$prod = $_POST['product'];
$ppu = $_POST["ppu"];
$pib = $_POST["pib"];
$quant = $_POST["quant"];
$amount = $ppu * $pib * 1.13;
if ($quant > 1) {
$amount = $quant * $pib * $ppu * 1.13;
}
require_once 'login.php';
$db_server = mysql_connect($db_hostname, $db_username, $db_password);
if (!$db_server) die("Unable to connect to MySQL: " . mysql_error());
mysql_select_db($db_database)
or die("Unable to select database: " . mysql_error());
$query = "INSERT INTO production (pnumber, vend, prod, ppu, uts, quant, costax, pID, date)
VALUES('$pnumber', '$vend', '$prod', '$ppu', '$pib', '$quant', '$amount', NULL, NULL)";
$result = mysql_query($query);
if (!$result) die ("Database access failed: " . mysql_error());
else {
echo "Created";
?><br />
<input type=button value=" Refresh" onClick=" history.back()" >
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment