Location: PHPKode > projects > FREE WAP PHP SCRIPTS CENTER > free_wap_ftp_client/upload.php
<?php
error_reporting(0);
$k=trim($_GET['k']); include("key.php");
$d=rawurldecode(trim($_GET['d'])); $n=rawurldecode(trim($_GET['n']));
if ($d==NULL) {$d="";} else {if ($d=="/") {$d="";}}
if ($n==NULL) {$n=preg_replace("~.*/([^/]*)~m","\\1",$d);
$d=preg_replace("~(.*)/[^/]*~m","\\1",$d);}
if ($n==NULL) {$n=preg_replace("~.*/([^/]*)~m","\\1",$d); $d=preg_replace("~(.*)/[^/]*~m","\\1",$d);}
$rd=rawurlencode($d); $rn=rawurlencode($n);
$d=str_replace(".|htaccess",".htaccess",$d);
$n=str_replace(".|htaccess",".htaccess",$n);

$cnt=count($_FILES['nm']['name']);

header("Content-Type: text/html; charset=utf-8");
echo ("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"><html>
<head><title>FTP - Upload wap4.org</title>
<meta forua=\"true\" http-equiv=\"Cache-Control\" content=\"no-cache\"></head>
<body bgcolor=\"#e6f5ff\" link=\"#0000aa\" vlink=\"#800000\"><small>
<a href=\"ftp.php?k=$k&amp;d=$rd&amp;n=$rn\">$d/$n</a><br>
- - -<br>\r\n");

if ($cnt<>NULL) {$st="";
 if (($ftp=@ftp_connect($sr))&&(@ftp_login($ftp,$lg,$ps))) {
  @ftp_pasv($ftp,true);
  for ($i=0;$i<$cnt;$i++) {
   if (($_FILES['nm']['name'][$i]<>NULL)&&($_FILES['nm']['size'][$i]<=7340032)&&($_FILES['nm']['size'][$i]>0)) {
    $name=preg_replace("~.*/([^/]*)~m","\\1",$_FILES['nm']['name'][$i]);
    if (ftp_put($ftp,"$d/$n/$name",$_FILES['nm']['tmp_name'][$i],FTP_BINARY)) {
     $sz=$_FILES['nm']['size'][$i];
     $st.="file \"".htmlspecialchars($name)."\" with $sz bytes size uploaded.<br>";
    } else {$st.="file \"".htmlspecialchars($name)."\" not uploaded.<br>";}
   }
  }
  @ftp_close($ftp);
  if ($st==NULL) {$st="not uploaded.<br>";}
  echo("$st- - -<br>");
 } else {
echo("no connection.
</small></body></html>");
exit;
 }
}

echo("<form action=\"$dftp/upload.php?k=$k&amp;d=$rd&amp;n=$rn\" enctype=\"multipart/form-data\" method=\"post\">files:<br>
<input name=\"nm[]\" type=\"file\"><br>
<input name=\"nm[]\" type=\"file\"><br>
<input name=\"nm[]\" type=\"file\"><br>
<input name=\"nm[]\" type=\"file\"><br>
<input name=\"nm[]\" type=\"file\"><br>
<input name=\"nm[]\" type=\"file\"><br>
<input name=\"nm[]\" type=\"file\"><br>- - -<br>
<input type=\"submit\" value=\"upload!\">
</form>
</small></body></html>");
?>
Return current item: FREE WAP PHP SCRIPTS CENTER