Ok... Well I fixed the quotes around the variable...
All I get outputted to the database is the address no variable afterward...
Here is my new code.
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($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;
}
}
$filenameout = "";
if ($_SERVER['REQUEST_METHOD'] == "POST")
{
$uploaddir = ".";
$pext = getFileExtension($imgfile_name);
$pext = strtolower($pext);
if (($pext != "jpg") && ($pext != "jpeg"))
{
print "<h1>ERROR</h1>Image Extension Unknown.<br>";
print "<p>Please upload only a JPEG image with the extension .jpg or .jpeg ONLY<br><br>";
print "The file you uploaded had the following extension: $pext</p>\n";
unlink($imgfile);
exit();
}
$imgsize = GetImageSize($imgfile);
if (($imgsize[0] > 250) || ($imgsize[1] > 200))
{
$tmpimg = tempnam("/tmp", "MKUP");
system("djpeg $imgfile >$tmpimg");
system("pnmscale -xy 250 200 $tmpimg | cjpeg -smoo 10 -qual 50 >$imgfile");
unlink($tmpimg);
}
$final_filename = str_replace(" ", "_", $imgfile_name);
$newfile = $uploaddir . "/$final_filename";
$filenameout = $final_filename;
if (is_uploaded_file($imgfile))
{
if (!copy($imgfile,"$newfile"))
{
print "Error Uploading File.";
exit();
}
}
unlink($imgfile);
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
}
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO c_4Sale (title, address, `description`, units, moRent, appFee, deposit, pets, sqft, bed, bath, petDeposit, petFee, elecPaid, watPaid, sewPaid, yardPaid, parking, features, img_1) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['title'], "text"),
GetSQLValueString($_POST['Address'], "text"),
GetSQLValueString($_POST['description'], "text"),
GetSQLValueString($_POST['units'], "text"),
GetSQLValueString($_POST['moRent'], "text"),
GetSQLValueString($_POST['appFee'], "text"),
GetSQLValueString($_POST['deposit'], "text"),
GetSQLValueString($_POST['pets'], "text"),
GetSQLValueString($_POST['sqft'], "text"),
GetSQLValueString($_POST['bed'], "text"),
GetSQLValueString($_POST['bath'], "text"),
GetSQLValueString($_POST['petDeposit'], "text"),
GetSQLValueString($_POST['petFee'], "text"),
GetSQLValueString($_POST['elecPaid'], "text"),
GetSQLValueString($_POST['watPaid'], "text"),
GetSQLValueString($_POST['sewPaid'], "text"),
GetSQLValueString($_POST['yardPaid'], "text"),
GetSQLValueString($_POST['parking'], "text"),
GetSQLValueString($_POST['features'], "text"),
GetSQLValueString($_POST['img_1'], "text"));
mysql_select_db($database_ControlPanel, $ControlPanel);
$Result1 = mysql_query($insertSQL, $ControlPanel) or die(mysql_error());
$insertGoTo = "../main.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
$imgfilenameout = "http://www.groupdominion.com/cp/add/" . $filenameout;
mysql_select_db($database_ControlPanel, $ControlPanel);
$query_Recordset1 = "SELECT * FROM c_4Sale WHERE img_1 = '$imgfilenameout' ORDER BY id ASC";
$Recordset1 = mysql_query($query_Recordset1, $ControlPanel) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>