Fatal error: Can't use function return value in write context in C:\AppServ\www\inc\download_file.php on line 7
Chodzi o ten wiersz
list ($fn, $ft, $fsmysql_fatch_array ($result, MYSQL_NUM);
Cało¶ć wygl±da tak
Download file
<?php include('header.inc'); ?> <?php require_once ('config.php'); $query = "SELECT file_name, file_type, file_size FROM uploads WHERE upload_id = {$_GE
T['uid']}"; list ($fn, $ft, $fsmysql_fatch_array ($result, MYSQL_NUM); $the_file = './test/' . $_GET['uid'] .'.' . $extension[1]; } $message = ' Wysłano'; } else { $message = ' Prosze wybprac plik'; $page_title = 'Pobieranie pliku'; echo $message ?> <?php include('stopka.inc'); ?>
Upload file
<?php $page_title = 'Upload a File'; require_once ('config.php'); // Function for escaping and trimming form data. function escape_data ($data) { } } // End of escape_data() function. // Check for a description (not required). $d = escape_data($_POST['description']); } else { $d = ''; } $query = "INSERT INTO uploads (file_name, file_size, file_type, description, upload_date) VALUES ('{$_FILES['upload']['name']}', {$_FILES['upload']['size']}, '{$_FILES['upload']['type']}', '$d', NOW())"; if ($result) { // Create the file name. $filename = $_FILES['upload']['name']; // Move the file over. } else { $query = "DELETE FROM uploads WHERE upload_id = $uid"; } } else { } } ?>
view_file
<?php $first = TRUE; //Initialize the variable. //query the db $query = "SELECT upload_id, file_name, ROUND(file_size/1024) AS fs, description, DATE_FORMAT(upload_date, '%M %e, %Y') AS d FROM uploads ORDER BY upload_date DESC"; //Display all the URLs //If this is the first record then create the table header if ($first) { echo '<table border="1" width="383" cellspacing="3" cellpadding="3" align="center"> <tr> <td align="left" width="20%"><font size="1px" color="#EDE3EB"><b>Nazwa Pliku</b></font></td> <td align="center" width="20%"><font size="1px" color="#EDE3EB" >Wielkosć</font></td> <td align="left" width="20%"><font size="1px" color="#EDE3EB" >Data</font></td> <td align="left" width="40%"><font size="1px" color="#EDE3EB" >Opis</font></td> </tr>'; } //End of first IF //Display each record echo " <tr> <td align=\"left\" class=\"ramka2\"><font color=\"white\"><a href=\"download_file.php?uid={$row['upload_id']}\">{$row['file_name']}</a></font></td> <td align=\"center\"class=\"ramka2\" ><font color=\"black\">{$row['fs']}kb</font></td> <td align=\"left\"class=\"ramka2\" ><font color=\"black\">{$row['d']}</font></td> <td align=\"left\"class=\"ramka2\" ><font color=\"black\">" . stripslashes($row['description']) . "</td> </tr>\n"; $first = FALSE; //one record has been returned } //End of while loop //If no records were displayed... if($first) { } else { } ?>