The connection to the database is good because on page 0 I have a drop down box that is generated from the database. Nothing gets inserted into the database. Is it because I am using strings? Someone told me to use pg_escape_string() but I don't understand how. If I am connecting in the uneditable region of the form from a template is it necessary to connect again?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html><!-- InstanceBegin template="/Templates/sv_temp.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<?php include("../ccdsv/dbconn3.php"); ?>
<title>Untitled Document</title>
</head>
<body><table width="100%" border="0">
<tr>
<th width="77%" valign="top" scope="col"><img name="sv_header" src="sv_header.gif" width="800" height="107" border="0" alt=""></th>
<th width="23%" rowspan="3" scope="col"> </th>
</tr>
<tr>
<td valign="top"> </td>
</tr>
<tr> <td valign="top">
<div align="left">
<!-- InstanceBeginEditable name="main" -->
<?php
$_GET['cboInst'];
switch ($_GET['submit']) {
case 'Add_Vessel': ?>
<form action="sv_t3.php" method="post">
<table width="100%" border="0">
<tr>
<td width="17%">Inventory Number </td>
<td width="27%"><input name="inv_no" type="text" id="inv_no" maxlength="50"></td>
<td width="20%">Mark</td>
<td width="36%"><input name="sv_mark" type="text" id="sv_mark" maxlength="50"></td>
</tr>
<tr>
<td>Sacred Vessel Type </td>
<td><input name="sv_type" type="text" id="sv_type"></td>
<td>Location of the Mark </td>
<td><input name="sv_mark_loc" type="text" id="sv_mark_loc" maxlength="50"></td>
</tr>
<tr>
<td>Sacred Vessel Name </td>
<td><input name="sv_name" type="text" id="sv_name"></td>
<td>Mark Description</td>
<td><input name="sv_mark_desc" type="text" id="sv_mark_desc" maxlength="50"></td>
</tr>
<tr>
<td>Artist</td>
<td><input name="sv_artist" type="text" id="sv_artist"></td>
<td>Inscription</td>
<td><input name="sv_inscript" type="text" id="sv_inscript" maxlength="50"></td>
</tr>
<tr>
<td>Exact Year </td>
<td><input name="sv_ex_year" type="text" id="sv_ex_year"></td>
<td>Location of Inscription </td>
<td><input name="sv_inscr_loc" type="text" id="sv_inscr_loc" maxlength="50"></td>
</tr>
<tr>
<td>Exact Year Source</td>
<td><input name="sv_ex_year_srce" type="text" id="sv_ex_year_srce"></td>
<td>Inscription Description</td>
<td><input name="sv_inscr_desc" type="text" id="sv_inscr_desc" maxlength="50"></td>
</tr>
<tr>
<td>Date/Period</td>
<td><input name="sv_date_period" type="text" id="sv_date_period"></td>
<td>Object Description </td>
<td><input name="sv_obj_desc" type="text" id="sv_obj_desc" maxlength="50"></td>
</tr>
<tr>
<td>How Determined </td>
<td><input name="sv_determined" type="text" id="sv_determined"></td>
<td>Provenance</td>
<td><input name="sv_provenance" type="text" id="sv_provenance" maxlength="50"></td>
</tr>
<tr>
<td>Certainty of Date/Period </td>
<td><input name="sv_date_certain" type="text" id="sv_date_certain"></td>
<td>Provenance Prior Owners </td>
<td><input name="sv_prior_own" type="text" id="sv_prior_own" maxlength="50"></td>
</tr>
<tr>
<td>Material</td>
<td><input name="sv_material" type="text" id="sv_material"></td>
<td>Description of Provenance </td>
<td><input name="sv_prov_desc" type="text" id="sv_prov_desc" maxlength="50"></td>
</tr>
<tr>
<td>Height</td>
<td><input name="sv_height" type="text" id="sv_height"></td>
<td>Acquisition</td>
<td><input name="sv_acquisition" type="text" id="sv_acquisition" maxlength="50"></td>
</tr>
<tr>
<td>Width</td>
<td valign="top"><input name="sv_width" type="text" id="sv_width"></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>Depth</td>
<td><input name="sv_depth" type="text" id="sv_depth"></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>Length</td>
<td><input name="sv_length" type="text" id="sv_length"></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>Diameter</td>
<td><input name="sv_diameter" type="text" id="sv_diameter"></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>Unit of Measure </td>
<td><input name="sv_uom" type="text" id="sv_uom"></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>Size Notes </td>
<td><textarea name="sv_size_notes" id="sv_size_notes"></textarea></td>
<td><p align="center">
<p align="center">
<input name="submit" type="submit" value="submit">
</td>
<td> </td>
</tr>
</table>
</form>
<?php
break;
case 'Edit_Vessel':
print 'This is what happens when Edit_Vessel button is clicked.';
break;
case 'Add_Window':
print 'This is what happens when the Add_Window button is clicked.';
break;
case 'Edit_Window':
print 'This is what happens when the Edit_Window button is clicked.';
break;
default:
print 'You can put the html form here.';
break;
} // End: switch ($_GET['submit'])
?></FORM> <!-- InstanceEndEditable --></td>
</tr>
</table>
<p> </p>
<tr>
<td height="2" colspan="3">
<p> </p></td>
</tr>
<div align="right"> </div>
<div align="right"> </div>
</body>
<!-- InstanceEnd --></html>
PAGE 2
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html><!-- InstanceBegin template="/Templates/sv_temp.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<?php include("../ccdsv/dbconn3.php"); ?>
<title>Untitled Document</title>
</head>
<body><table width="100%" border="0">
<tr>
<th width="77%" valign="top" scope="col"><img name="sv_header" src="sv_header.gif" width="800" height="107" border="0" alt=""></th>
<th width="23%" rowspan="3" scope="col"> </th>
</tr>
<tr>
<td valign="top"> </td>
</tr>
<tr> <td valign="top">
<div align="left">
<!-- InstanceBeginEditable name="main" -->
<?php
include '../dbconn.php';
$msg = '';
if (!empty($POST['inv_no']) && !empty($POST['sv_type']) && !empty($_POST['sv_name'])) {
require('../dbconn.php');
$inv_no = $_POST['inv_no'];
$sv_type = $_POST['sv_type'];
$sv_name = $_POST['sv_name'];
echo $sv_name; ?> <br>
<?php echo $inv_no; ?> <br>
<?php echo $sv_type;
?>
<?php $query ="INSERT INTO tbl_vessel ( inv_no, sv_type, sv_name )".
"values ('$inv_no', '$sv_type', '$sv_name')";
$result=pg_Exec ($conn, $query);
}
?>
<p><br>
</font>
<br>
<br>
<font size="5" color="330099" face="Arial, Helvetica, sans-serif">
The web browser will be redirected to the main webpage.</font></p>
<meta http-equiv="refresh" content="10; URL=http:///">
<!-- comment out return to page for testing
end comment -->
<!-- InstanceEndEditable --></td>
</tr>
</table>
<p> </p>
<tr>
<td height="2" colspan="3">
<p> </p></td>
</tr>
<div align="right"> </div>
<div align="right"> </div>
</body>
<!-- InstanceEnd --></html>