Pisze sobie modul downloadu do systemy newsow.
Mam taki kod i dalej nie wiem jak to ruszyc.....
<?php if($member_db[1] != 1){ msg(\"error\", \"Dostêp zabroniony\", \"Nie masz uprawnieñ\"); } echoheader(\"files\",\"Files\"); $version = \"0.0.1\"; $config_path_file_upload = \"./data/upfiles\"; $config_path_file_download = \"http://localhost/cute/data/upfiles\"; $file = \"./data/files.db.php\"; if($subaction == \"upload\") { if(!$plik) { $plik = $HTTP_POST_FILES['plik']['tmp_name']; } if(!$plik_name) { $plik_name = $HTTP_POST_FILES['plik']['name']; } if($plik_name == \"\") { $img_result = \"<br><font color=red>No File Specified For Upload !!!</font>\"; } { $img_result = \"<br><font color=red>plik already exist !!!</font>\"; } elseif( !(in_array($type, $allowed_extensions) or in_array(strtolower($type), $allowed_extensions)) ) { $img_result = \"<br><font color=red>This type of file is not allowed !!!</font>\"; } else { @copy($plik, $config_path_file_upload.\"/\".$plik_name) or $img_result = \"<font color=red>Couldn't copy file to server</font><br />\"; { $img_result = \"<br><font color=green>file was uploaded</font>\"; } } } echo\"<table border=0 cellpading=0 cellspacing=0 width=100%> <FORM action='$PHP_SELF?mod=files' METHOD='POST' ENCTYPE=\"multipart/form-data\"> <input type=hidden name=subaction value=upload> <input type=hidden name=area value='$area'> <input type=hidden name=action value='$action'> <td height=33> <b>Upload plik</b> <table border=0 cellpading=0 cellspacing=0 class=\"panel\" cellpadding=8> <tr> <td height=25> <input type=input name=opis size=23><br><br> <input type=submit value='Upload'><br><br> <input type=checkbox name=overwrite value=1> Overwrite if exist?<br><br> <b>$img_result</b></tr> </form> </table> </table>\"; ////////////////// ///////// { $found = FALSE; $file = \"./data/files.db.php\"; } ///////////////// ///////// for ($i = 1; $i < $tmpcount; $i++) { } //////// echofooter(); ?>
1. Jak zrobic zeby przy uploadzie plik ktory jest zapisywany na serwerze dodal sie takze do pliku txt (bazy) i zeby przy odswiezaniu strony nie pojawialy sie nowe wpisy?
2. I jak teraz usuwac pliki jednoczesnie z pliku i z katalogu gdzie zostal uploadowany?
3. Skrzynke piwa wysle kurierem

Pozdrawiam