I've actually figured out how to do what I want in Dreamweaver MX (some may have seen my post in the n00bs section).
I've got the test form and when I try to submit, I get the following error:
Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /home/www/popstalin.com/test_form3.php on line 50
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/www/popstalin.com/test_form3.php on line 51
Here's where you can view the form:
http://www.popstalin.com/test_form4.php
Here is the code preceeding this error:
<?php require_once('http://www.popstalin.com/CONNECTIONS/POP_STALIN.php'); ?>
<?php
function GetSQLValueString
($theValue, $theType,
$theDefinedValue = "",
$theNotDefinedValue = "")
{
$theValue =
(!get_magic_quotes_gpc()) ? addslashes($theValue) :
$theValue;
switch ($theType) {
case "text":
$theValue = ($theValue != "")
? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "")
? "'" . doubleval($theValue) . "'"
: "NULL";
break;
case "date":
$theValue = ($theValue != "")
? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue :
$theNotDefinedValue;
break;
}
return $theValue;
}
$editFormAction = $HTTP_SERVER_VARS['PHP_SELF'];
if (isset($HTTP_SERVER_VARS
['QUERY_STRING'])) {
$editFormAction .= "?" . $HTTP_SERVER_VARS
['QUERY_STRING'];
}
if ((isset($HTTP_POST_VARS
["MM_insert"])) && ($HTTP_POST_VARS
["MM_insert"] == "form1")) {
$insertSQL = sprintf
("INSERT INTO MAA_Dealer_Information
(`First Name`, `Last Name`,
`Dealership Name`, `Car Location`,
Phone, `Auction Access #`,
`Work Order #`, `Complaint Date`,
`Date Resolved`, `Complaint ID`,
`Report by`, Title, `Title Location`,
`Dealership Location`) VALUES
(%s, %s, %s, %s, %s, %s, %s,
%s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($HTTP_POST_VARS
['First_Name'], "text"),
GetSQLValueString($HTTP_POST_VARS
['Last_Name'], "text"),
GetSQLValueString($HTTP_POST_VARS
['Dealership_Name'], "text"),
GetSQLValueString($HTTP_POST_VARS
['Car_Location'], "text"),
GetSQLValueString($HTTP_POST_VARS
['Phone'], "int"),
GetSQLValueString($HTTP_POST_VARS
['Auction_Access_'], "int"),
GetSQLValueString($HTTP_POST_VARS
['Work_Order_'], "int"),
GetSQLValueString($HTTP_POST_VARS
['Complaint_Date'], "date"),
GetSQLValueString($HTTP_POST_VARS
['Date_Resolved'], "date"),
GetSQLValueString($HTTP_POST_VARS
['Complaint_ID'], "int"),
GetSQLValueString($HTTP_POST_VARS
['Report_by'], "text"),
GetSQLValueString(isset($HTTP_POST_VARS
['Title']) ? "true" : "", "defined","'Y'","'N'"),
GetSQLValueString($HTTP_POST_VARS
['Title_Location'], "text"),
GetSQLValueString($HTTP_POST_VARS
['Dealership_Location'], "text"));
And here is what is after:
$insertGoTo = "http://www.popstalin.com/top.php";
if (isset($HTTP_SERVER_VARS
['QUERY_STRING'])) {
$insertGoTo .=
(strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .=
$HTTP_SERVER_VARS
['QUERY_STRING'];
}
header(sprintf("Location: %s",
$insertGoTo));
}
?>
<?php require_once('http://www.popstalin.com/CONNECTIONS/POP_STALIN.php'); ?>
Then it's followed by some HTML but I figure this is what is needed to help diagnose my problem.
I tried commenting lines 50 & 51 then I got a parse error.
HELP?!
TIA!