// Update the info table $update_sql = 'UPDATE ' . $info_table . " SET binname = '{$bin_name}', bintype = '{$bin_type}', binsize = '{$bin_size}'" . $mod_sql . " WHERE id = '{$id}'"; mysql_query($update_sql) or die("<h2>MySQL error</h2> " . mysql_errno() . " : " . mysql_error()); $binaryid = $id; if (isset($bin_src, $bin_type, $bin_name, $bin_size)) { $fp = fopen($bin_src, "rb"); while (!feof($fp)) { $binarydata = addslashes(fread($fp, 655350)); //10*(Max-value-of-BLOB) $sql2 = 'INSERT INTO ' . $data_table . ' (masterid, bindata) ' . 'VALUES (' . $binaryid . ", '" . $binarydata . "')"; if (!mysql_query($sql2)) { die("<h2>MySQL error</h2> " . mysql_errno() . " : " . mysql_error()); } } fclose($fp); //close the file... } } // End of uploading file $contents = log_updated('files/index', 'bin_check'); $contents .= file_uploaded(); xhtml_output(''); } } else { header('Location: ' . $http . '://' . $_SERVER['HTTP_HOST'] . $cfg['root_path'] . 'index.php'); exit; } } else { header('Location: ' . $http . '://' . $_SERVER['HTTP_HOST'] . $cfg['root_path'] . 'index.php'); exit; }
mb_convert_variables($cfg['mysql_lang'], "auto", $name, $category, $comment); } // Update query $sql = 'UPDATE ' . $log_table . " SET `name` = '{$name}', `href` = '{$href}', `category` = '{$category}', `comment` = '{$comment}'"; if (isset($_POST['no_update_mod'])) { $mod = $_POST['mod']; $sql .= ", `mod` = '{$mod}'"; } else { $cmod = gmdate('YmdHis', time() + $cfg['tz'] * 3600); $sql .= ", `mod` = '{$cmod}'"; } // Make private if (isset($_POST['private'])) { $sql .= ", `draft` = '1'"; } $sql .= "WHERE `id` = '{$id}'"; mysql_query($sql) or die("<h2>MySQL error</h2> " . mysql_errno() . " : " . mysql_error()); $new_id = $id; $contents = log_updated('index', 'check'); $contents .= file_uploaded(); $contents .= send_trackback(); xhtml_output(''); } } else { header('Location: ' . $http . '://' . $_SERVER['HTTP_HOST'] . $cfg['root_path'] . 'index.php'); exit; } } else { header('Location: ' . $http . '://' . $_SERVER['HTTP_HOST'] . $cfg['root_path'] . 'index.php'); exit; }