хочу прикрутить аплоад картинки к модулю....
а именно к этим функциям добавления фильма в БД
функции писал сам вот хотелось бы прикрутить к ним аплоад картинки фильма
функцию upload() нашел в файле function/sources.php
вот и решил попросить помощи чтоб кто то расказал как ней правильно пользоваться
что не делал картинки не аподиться ((((
КОД
function Film_add() {
global $prefix, $db, $admin_file;
include("header.php");
hot("Добавление фильма");
QualityHelper();
OpenTable();
echo "<form name=\"post\" action=\"".$admin_file.".php\" method=\"post\">";
OpenNews();
echo "<table border=\"0\" cellpadding=\"3\" cellspacing=\"0\" align=\"center\" style=\"color:#3a4f6c\">";
echo "<tr><td><img src=\"images/small_flags/ru.gif\"> Название на рус.</td><td><input id=\"input_news\" type=\"text\" name=\"title_ru\" size=\"65\" style=\"width:550px\"></td></tr>";
echo "<tr><td><img src=\"images/small_flags/uk.gif\"> Название на анг.</td><td><input id=\"input_news\" type=\"text\" name=\"title_en\" size=\"65\" style=\"width:550px\"></td></tr>";
echo "<tr><td>Жанр</td><td> ";
$genrelist = $db->sql_query("SELECT id, genre_name FROM video_db_genres ORDER BY genre_name");
echo "<select id=\"input_news2\" name=\"genre\" style=\"width:550px\">";
while(list($genre_id, $genre_name) = $db->sql_fetchrow($genrelist)) {
$genre_id = intval($genre_id);
if ($genre_id == $genre_name) {
$sel = "selected ";
}
echo "<option class=\"q_\" $sel value=\"$genre_id\">$genre_name</option>\n";
$sel = "";
}
echo "</select></td></tr>";
$date = getdate();
$year = $date[year];
echo "<tr><td>Год выпуска</td><td><input id=\"input_news\" type=\"text\" name=\"year\" value=\"$year\" size=\"5\" maxlength=\"4\" style=\"width:550px\"></td></tr>";
echo "<tr><td>Страна</td><td> ";
$countrylist = $db->sql_query("SELECT id, country FROM video_db_country ORDER BY country ASC");
echo "<select id=\"input_news2\" name=\"country\" style=\"width:550px\">";
while(list($country_id, $country_name) = $db->sql_fetchrow($countrylist)) {
$country_id = intval($country_id);
if ($country_id == $country_name) {
$sel = "selected ";
}
echo "<option class=\"q_\" $sel value=\"$country_id\">$country_name</option>\n";
$sel = "";
}
echo "</select></td></tr>";
echo "</table>";
CloseNews();
OpenNews();
echo "<table border=\"0\" cellpadding=\"3\" cellspacing=\"0\" align=\"center\" style=\"color:#3a4f6c\">";
echo "<tr><td><img src=\"images/flags/WORLD.gif\"> Премьера в Мире </td><td>";
echo "<table>";
echo "<tr><td>День </td><td><input id=\"input_news\" type=\"text\" name=\"p_world_day\" size=\"2\" style=\"width:20px\"></td>";
echo "<td>Месяц </td><td><input id=\"input_news\" type=\"text\" name=\"p_world_month\" size=\"2\" style=\"width:20px\"></td>";
echo "<td>Год </td><td><input id=\"input_news\" type=\"text\" name=\"p_world_year\" size=\"4\" style=\"width:40px\"></td></tr>";
echo "</table>";
echo "</td></tr>";
echo "<tr><td><img src=\"images/small_flags/ua.gif\"> Премьера в Украине</td><td>";
echo "<table>";
echo "<tr><td>День </td><td><input id=\"input_news\" type=\"text\" name=\"p_ua_day\" size=\"2\" style=\"width:20px\"></td>";
echo "<td>Месяц </td><td><input id=\"input_news\" type=\"text\" name=\"p_ua_month\" size=\"2\" style=\"width:20px\"></td>";
echo "<td>Год </td><td><input id=\"input_news\" type=\"text\" name=\"p_ua_year\" size=\"4\" style=\"width:40px\"></td></tr>";
echo "</table>";
echo "</td></tr>";
echo "<tr><td>Саундтрек ID альбома</td><td><input id=\"input_news\" type=\"text\" name=\"soundtrack\" size=\"65\" style=\"width:550px\"></td></tr>";
echo "</table>";
CloseNews();
OpenNews();
echo "<table border=\"0\" cellpadding=\"3\" cellspacing=\"0\" align=\"center\" style=\"color:#3a4f6c\">";
echo "<tr><td>Режиссер</td><td> ";
$directlist = $db->sql_query("SELECT id, title_ru, title_en FROM video_db_directors ORDER BY title_ru ASC");
echo "<select id=\"input_news2\" name=\"director\" style=\"width:550px\">";
while(list($id, $title_ru, $title_en) = $db->sql_fetchrow($directlist)) {
$id = intval($id);
if ($id == $title_ru) {
$sel = "selected ";
}
echo "<option class=\"q_\" $sel value=\"$id\">$title_ru / $title_en /</option>\n";
$sel = "";
}
echo "</select></td></tr>";
echo "<tr><td valign=\"top\">Актеры / Актрисы</td><td><textarea id=\"input_news\" name=\"actors\" cols=\"65\" rows=\"3\" style=\"width:550px\"></textarea></td></tr>";
echo "<tr><td valign=\"top\">Краткое описание </td><td><textarea id=\"textarea\" name=\"about\" cols=\"65\" rows=\"10\" style=\"width:550px\"></textarea></td></tr>";
echo "</table><center><input type=\"hidden\" name=\"cover\" value=\"$cover\"><input type=\"hidden\" name=\"op\" value=\"Film_add_db\">";
echo "<input type=\"submit\" id=\"input_green\" value=\"Добавить фильм\">";
CloseNews();
echo "</form>";
include("footer.php");
}
function Film_add_db($title_ru, $title_en, $cover, $genre, $year, $country, $p_world_day, $p_world_month, $p_world_year, $p_ua_day, $p_ua_month, $p_ua_year, $soundtrack, $director, $actors, $about, $aid) {
global $aid, $prefix, $db, $admin_file;
$ip = getenv("REMOTE_ADDR");
$db->sql_query("INSERT INTO video_db_films VALUES (NULL, '$title_ru', '$title_en', '$cover', '$genre', now(), '$year', '$country', '$p_world_day', '$p_world_month', '$p_world_year', '$p_ua_day', '$p_ua_month', '$p_ua_year', '$director', '$actors', '$about', 0, 0, 1, '$soundtrack', 0, 0, 0, 0, '$aid', '$ip', 0)");
Header("Location: ".$admin_file.".php?op=Films");
}