if ($check_it)
{
// if ( (!isset($phone1) || ($phone1=="") || (!isset($email) || ($email=="") ) {
if ( (!isset($email)) || ($email=="") ) {
unset($check_it);
echo 'Please...
';
echo 'In order to respond promply, we need your Email address.
';
echo 'Please click the button, add your Email address.
';
echo ' Return to Form to Add Information ';
exit;
}
}
if ($check_it)
{
$debug = 0;
// ================== check_ it database =================
include $path."/db_inq.php";
$table="tbl_inquiry";
$type="new";
$updated=date("Y-m-d"); //last update
$interested="y";
$max_fields=27;
if ($source == "Other") $source = $source2;
// default values
$db = mysql_connect($hostname, $user, $pwd);
if (!$db)
{
echo "Error: Could not connect to database for Writing.";
exit;
}
mysql_select_db($dbase);
$query = "INSERT into $table VALUES
('".$type."', '".$inq_id."', '".$fname."', '".$lname."',
'".$email."', '".$title."', '".$organization."', '".$address."', '".$address2."',
'".$city."', '".$state."', '".$zip."',
'".$country."', '".$phone."', '".$fax."', '".$comments."',
'".$urgency."', '".$updated."', '".$interested."', '".$remove."',
'".$productref."', '".$referer."', '".$source."',
'".$sal."', '".$mname."', '".$suffix."', '".$taker."')";
if ($debug==1) {
echo $query;
echo " ";
}
$result = mysql_query($query);
if (!$result)
{
echo "
Could not get initial database read. ".$field_name[$i]." ";
echo mysql_errno() . ": " . mysql_error() . " ";
}
if ($debug==1) echo "affected rows ".mysql_affected_rows()." ";
$last_row = mysql_insert_id();
if ($debug==1) echo 'New id is '.$last_row.' ';
// $num_fields = mysql_num_fields($result);
// if ($debug==1) echo 'num_fields='.$num_fields.' ';
// $debug=1;
// ======================================================
// echo "Done... ";
// ============== end check_it database =========================
// ================== check_ it email =================
if (!$referer) {
$referer= getenv('HTTP_REFERER');
if ($debug==1) echo 'No Referer, so now it is '.$referer;
}
echo ' |