View file wapp_antifront.com/upload/common.php

File size: 3.63Kb
<?php

/* Upload Routine */

if(isset($fupload))
{

	require 'config.php';

	$ext = strrchr($fupload_name,'.');

	if ($ext == $filetype1 || $ext == $filetype2 || $ext == $filetype3 || $ext == $filetype4 || $ext == $filetype5 || $ext == $filetype6 || $ext == $filetype7 || $ext == $filetype8 || $ext == $filetype9)
	{

	/* Peform Upload Actions */

	$final_path=$file_dir . "/" . $fupload_name;					# Generate final path & filename.
	move_uploaded_file( $fupload, $final_path ) or die ("Unable To Copy");	# Moves file.


	/* Perform Post Upload Actions */

	upload_report($fupload, $fupload_name, $fupload_size, $fupload_type, $file_url, $file);	# Call upload report generation function.

	}

	else
	{

	echo '<script language="JavaScript">';

	echo 'error = window.open("error.php?id=filetype","","width=350,height=235,status=no,toolbar=no,menubar=no");';

	echo '</script>';

       }

}

?>



<?php

/* Upload Report Generation Function */

function upload_report($fupload, $fupload_name, $fupload_size, $fupload_type, $file_url, $file)
{

   	/* Generate Upload Report */

	require('config.php');

	echo '<font face="verdana" color="ffff00" text="#800080">';
	echo "<img src='$logo_file'>";
	Print "<h3>&#x444;&#x430;&#x439;&#x43B; &#x443;&#x434;&#x430;&#x447;&#x43D;&#x43E; &#x437;&#x430;&#x433;&#x440;&#x443;&#x436;&#x435;&#x43D;</h3>";
	echo '</font>';
echo '<font fache="verdana" color="#800080">';


	print "<b>&#x438;&#x43C;&#x44F; &#x444;&#x430;&#x439;&#x43B;&#x430;:</b> $fupload_name<br>";
	print "<b>&#x432;&#x435;&#x441;: </b> $fupload_size bytes<br>";
	print "<b>&#x444;&#x43E;&#x440;&#x43C;&#x430;&#x442;:  </b> $fupload_type<p>";echo '</font>';
echo '<font face="verdana" color="#00ffff">';
	print "<b>&#x43E;&#x431;&#x43C;&#x435;&#x43D;&#x438;&#x432;&#x430;&#x439;&#x442;&#x435;&#x441;&#x44C; &#x444;&#x430;&#x439;&#x43B;&#x430;&#x43C;&#x438; &#x43D;&#x430;                           http://lim.hih.ru</b><br>";
echo '</font>';

}

?>



<?php

/* Directory Listing Function */

function directory_listing($file_dir, $file_url)
{

  require('config.php');									# Reads in configuration file.

  $directory = opendir ($file_dir);		    					# Open Directory for reading.

  echo '<div class = "container">';							# Use CSS Class (container).

  echo '<font face="verdana" color="darkblue">';					# Sets font face & color.
  echo "<img src='$logo_file'>";								# Display FileFusian logo.

  echo '<div class = "header">';								# Use CSS class (header).
  echo '<h3>Directory Listing</h3>';							# Display file listing page title.
  echo '</div>';										# End CSS class (header).

  print "<h6>A maximum of $listsize files will be displayed.</h6>";			# Displays number of files to be displayed.
  print "<hr>";										# Displays horizontal rule.

  echo '<table>';					     					# Create table.

  for($fcount = 0; $fcount < $listsize; $fcount++)   					# File display loop - runs until $listsize value is reached.
    {

      $file = readdir ($directory);
      echo '<tr><td>';				     					# Create table row, get ready for data.

      if($file != "" && $file != "." && $file != "..")
      {

      echo '<img src="http://efusian.co.uk/~filefusian/images/download.gif">';	# Link to download icon.

      print "  <a href='$file_url/$file'>$file</a>";					# Prints filename hyperlink to directory listing.

      }

      echo '</td></tr>';				     					# Close table data and row.

    }

  echo '</table>';					     					# Close table.

  echo '</div>';										# End CSS class (container).

  closedir ($directory);				     					# Close directory.

}

?>