Okay, well, I'm still new at this, so this seems to be the place to post this message. I'm using a one page update form with PHP to insert information into my PostgreSQL database. Now this seems more like a HTML function than anything, but I'm going through my books and can't find anything but "Do it in the header". The code is posted below. After it does the insert, I want it to display a confirmation message, and hopefully auto-refresh after like 5 seconds. Can anyone help? Thanks a bunch guys!
<html>
<head>
<title>Shipper Input</title>
</head>
<body bgcolor="#D5D5AB" text="#000000" link="#0000FF" vlink="#FF0000" alink="#6FF00">
<div align="left">
<h2 align="left"><img src="/VAD/Avnet_LSC.jpg" width="222" height="72" />
</h2>
<h2 align="left"><u><strong><font size="6">Input New Shipper</font></strong><u></h2> </div>
<?
if (!$submit)
{
?>
<form action="<? echo $_SERVER['PHP_SELF']; ?>" method="POST">
Company:<br>
<input name="company" type="text" size="10" maxlength="4">
<p>
Invoice:<br>
<input name="invoice" type="text" size="10" maxlength="7">
<p>
Quantity:<br>
<input name="quantity" type="text" size="10" maxlength="10">
<p>
PC Charge:<br>
<input name="pc_charge" type="text" size="10" maxlength="10">
<p>
Month:<br>
<input name="month" type="text" size="10" maxlength="10">
<p>
Year:<br>
<input name="year" type="text" size="10" maxlength="4">
<p>
<input type="submit" name="submit" value="Add New Record">
</form>
<?
}
else
{
$host = "172.16.30.45";
$user = "aaron";
$db = "VADtest";
$connection = pg_Connect("host=$host dbname=$db user=$user");
if (!$connection)
{
die("Could not open connection to the database server");
}
$query = "INSERT INTO shipper VALUES ('$company', '$invoice', '$quantity', '$
c_charge', '$month', '$year')";
$result = pg_query($connection, $query) or die("Error in query: $query. " . p
_last_error($connection));
pg_close($connection);
}
?>
</body>
</html>