trolll,
exactly....ah mean i know this so it was the first thing i was looking for...the php process doesn;t need to print anything so i thought it was a mistake i made....but i dont see it... the only thing it probably does is define some new variable
Code: Select all
$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_update"])) && ($HTTP_POST_VARSї"MM_update"] == "form1")) {
$errStr = false;
if (phpversion() > "4.0.6") {
$HTTP_POST_FILES = &$_FILES;
}
define("MAX_SIZE",30000);
define("DESTINATION_FOLDER", "../images/references_images");
$_accepted_extensions_ = "jpeg,jpg";
if(strlen($_accepted_extensions_) > 0){
$_accepted_extensions_ = @explode(",",$_accepted_extensions_);
} else {
$_accepted_extensions_ = array();
}
$_file_ = $HTTP_POST_FILESї'IMG'];
if(is_uploaded_file($_file_ї'tmp_name']) && $HTTP_POST_FILESї'IMG']ї'error'] == 0){
$_name_ = $_file_ї'name'];
$_type_ = $_file_ї'type'];
$_tmp_name_ = $_file_ї'tmp_name'];
$_size_ = $_file_ї'size'];
if($_size_ > MAX_SIZE && MAX_SIZE > 0)
$errStr = "File Size should NOT exceed 30000Bytes (30KB)";
$_ext_ = explode(".", $_name_);
$_ext_ = strtolower($_ext_їcount($_ext_)-1]);
if(!in_array($_ext_, $_accepted_extensions_) && count($_accepted_extensions_) > 0)
$errStr = "Invalid Extension. Please Upload only JPEG('.jpg') extension FILES!!!";
if(!is_dir(DESTINATION_FOLDER) && is_writeable(DESTINATION_FOLDER))
$errStr = "Could not Upload File. Please check the directory";
if($errStr == false){
if(@copy($_tmp_name_,DESTINATION_FOLDER . "/" . $_name_))
$Image = $_name_;
else $errStr = 'Could not Upload File. Please try again';
}
}
if($errStr == false){
$updateSQL = sprintf("UPDATE references_table SET Company=%s, Image=%s, Description=%s, Category=%s WHERE `REF`=%s",
GetSQLValueString($HTTP_POST_VARSї'Company'], "text"),
GetSQLValueString(isset($Image) ? $Image : "NULL", "text"),
GetSQLValueString($HTTP_POST_VARSї'Description'], "text"),
GetSQLValueString($HTTP_POST_VARSї'Category'], "int"),
GetSQLValueString($HTTP_POST_VARSї'REF'], "int"));
mysql_select_db($database_Resco_Products, $Resco_Products);
$Result1 = mysql_query($updateSQL, $Resco_Products) or die(mysql_error());
$Status = 'Reference REF# -'.$HTTP_POST_VARSї'REF'].' updated!';
$updateGoTo = "list_reference.php?Status=".urlencode($Status);
if (isset($HTTP_SERVER_VARSї'QUERY_STRING'])) {
$updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
$updateGoTo .= $HTTP_SERVER_VARSї'QUERY_STRING'];
}
header(sprintf("Location: %s", $updateGoTo));
exit;
}
now as i said with the above code....im using it as is in a next script give or take a few variable....and it works. can you detect anything here
Kendall