View Single Post
  #5 (permalink)  
Old 30-11-2004, 09:30 AM
eina_227's Avatar
eina_227 eina_227 is offline
Novice Webmaster
 
Join Date: Nov 2004
Location: selangor
Posts: 11
Rep Power: 0
eina_227 is on a distinguished road
$record = array(); # Initialize an array to hold the record data to insert
$test=$_FILES['attachment']['size'];
if ($test > ($_POST['MAX_FILE_SIZE']))
{
$msg = _ADDFAILED . "<br>" . $dbconn->ErrorMsg();
}
else
{


// Set the values for the fields in the record


$filename = "$owner" . "_" . $_FILES['attachment']['name'];

$record[$column['attachment']['type']] = $_FILES['attachment']['type'];

$record[$column['attachment']['size']] = $_FILES['attachment']['size'];

if(move_uploaded_file($_FILES['attachment']['tmp_name'], $conf['path']['folder']['attachments'] . "/$module/$filename"))
{
$record[$column['attachment']['filename']] = $filename;
}
$record[$column['attachment']['module']] = $module;
$record[$column['attachment']['owner']] = $owner;
$record[$column['attachment']['desc']] = common::checkslashes($_REQUEST['desc']);
$record[$column['attachment']['keywords']] = common::checkslashes($_REQUEST['keywords']);
$record[$column['attachment']['cre_by']] = $_SESSION['sess_ref_id'];
$record[$column['attachment']['cre_time']] = time();
$record[$column['attachment']['upd_by']] = $_SESSION['sess_ref_id'];
$record[$column['attachment']['upd_time']] = time();

$sql = "SELECT * FROM " . $table['attachment'] . " WHERE " . $column['attachment']['id'] . " = -1";
// Select an empty record from the database

$rs = $dbconn->Execute($sql); // Execute the query and get the empty recordset

$insertSQL = $dbconn->GetInsertSQL($rs, $record); //generating insert statement

$result = $dbconn->Execute($insertSQL);
$msg = _ADDSUCCEED;

//common::AutoRedirect($delay,$goto,$code,$param,$ms g)
$param = "&c_code=$owner&category=$category";
if(isset($_REQUEST['ispopup']) && $_REQUEST['ispopup'] == "1")
$param .= "&ispopup=1";
common::AutoRedirect(1,common::PrepUrl("goto.php") ,"contact_attachment","$param","$msg");
__________________
-ariana zellina-
Reply With Quote