"Fossies" - the Fresh Open Source Software Archive

Member "eventh/downloadfiles.php" (26 Jan 2010, 3081 Bytes) of package /linux/privat/old/eventh-1.1.11.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PHP source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "downloadfiles.php" see the Fossies "Dox" file reference documentation.

    1 <?
    2 /*
    3 This file is part of Event Horizon (EVH).
    4 
    5 EVH is free software; you can redistribute it and/or modify
    6 it under the terms of the GNU General Public License as published by
    7 the Free Software Foundation; either version 3 of the License, or
    8 (at your option) any later version.
    9 
   10 EVH is distributed in the hope that it will be useful,
   11 but WITHOUT ANY WARRANTY; without even the implied warranty of
   12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   13 GNU General Public License for more details.
   14 
   15 You should have received a copy of the GNU General Public License
   16 along with this program.  If not, see <http://www.gnu.org/licenses/>.
   17 */
   18 
   19     include "inc.php";
   20     $query="select Sessions.id, Sessions.dnldcode, Sessions.modcode, Files.id, Files.sessionid, Files.name, Files.description from Sessions,Files where (Sessions.dnldcode=\"" . addslashes($VerificationNumber) . "\" or Sessions.modcode=\"" . addslashes($VerificationNumber) . "\") and (Sessions.destemail like \"%" . addslashes($YourEmail) . "%\" or Sessions.srcemail like \"%" . addslashes($YourEmail) . "%\") and Files.sessionid=Sessions.id;";
   21     $res = mysql_query($query,$dbh) or die("<p><b>A fatal database error occured</b>.\n<br />Query: " . $query . "<br />\nError: (" . mysql_errno() . ") " . mysql_error());
   22     $numfound = mysql_num_rows($res);
   23 ?>
   24 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
   25 <html>
   26 <head>
   27 <title><?=$appname; ?> - File Listing</title>
   28 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
   29 <link href="default.css" rel="stylesheet" type="text/css">
   30 </head>
   31 <body>
   32 <?=$titleandmenu; ?>
   33 <?
   34 if ($numfound != 0) {
   35     //echo $query . "<p>";
   36     while($row = mysql_fetch_row($res)){
   37     
   38         //if ($row[7] != "") $realname = $row[7];
   39         //else $realname = $row[5];
   40         $realname = $row[5];
   41         $fsize = filesize("$fpath/" . stripslashes($row[1]) . "/$realname");
   42         
   43         echo '<table width="500"  border="0" align="center" cellpadding="3" cellspacing="1" class="border">';
   44         echo '<tr>';
   45         echo '<th width="150" align="left" valign="top" nowrap class="header" scope="row">Filename</th>';
   46         echo '<td align="left" valign="middle" nowrap class="content" scope="row"><a href="sendfile.php?fid=' . $row[3] . '&vercode=' . stripslashes($row[1]) . '">' . stripslashes($row[5]) . '</a></td>';
   47         echo '</tr>';
   48         echo '<tr>';
   49         echo '<th width="150" align="left" valign="top" nowrap class="header" scope="row">Description</th>';
   50         echo '<td align="left" valign="middle" nowrap class="content" scope="row">' . stripslashes($row[6]) . '</td>';
   51         echo '</tr>';
   52         echo '<tr>';
   53         echo '<th width="150" align="left" valign="top" nowrap class="header" scope="row">Size</th>';
   54         echo '<td align="left" valign="middle" nowrap class="content" scope="row">' . round($fsize/1024/1024,2) . ' MB</td>';
   55         echo '</tr>';   
   56         echo '</table>';
   57         echo '<p>'; 
   58     }
   59 }
   60 else echo '<div align="center"><font color=red size=-1>File not found</font></div>';
   61 ?>
   62 <?
   63 print $footer;
   64 ?>
   65 
   66 </body>
   67 </html>