Location: PHPKode > projects > FREE WAP PHP SCRIPTS CENTER > free_wap_ftp_client/ftp.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="";} if ($n==NULL) {$n="";}
$rd=rawurlencode($d); $rn=rawurlencode($n);
$d=str_replace(".|htaccess",".htaccess",$d);
$n=str_replace(".|htaccess",".htaccess",$n);

header("Content-Type: text/vnd.wap.wml; charset=Utf-8");
echo("<?xml version=\"1.0\" encoding=\"Utf-8\"?><!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\" \"http://www.wapforum.org/DTD/wml_1.2.xml\"><wml>
<card title=\"FTP - ".strtoupper($lg)."\">
<do name=\"back\" type=\"options\" label=\"back\"><prev/></do><do name=\"go\" type=\"options\" label=\"g o to\"><go href=\"$dftp/go.php?k=$k&amp;d=$rd&amp;n=$rn\"/></do><do name=\"faq\" type=\"options\" label=\"FAQ\"><go href=\"$dftp/faq.php\"/></do><do name=\"exit\" type=\"options\" label=\"exit\"><go href=\"$dftp/exit.php?k=$k\"/></do>\r\n");

if (($ftp=@ftp_connect($sr))&&(@ftp_login($ftp,$lg,$ps))) {
 @ftp_pasv($ftp,true); $links="";
 ftp_chdir($ftp,$d."/".$n); $curd=ftp_pwd($ftp);
 if ($curd<>"/") {
  $back=preg_replace("~(.*)/[^/]*~m","\\1",$curd);
  $back=str_replace(".htaccess",".|htaccess",$back);
 }
 include("flist.php"); $fls=flist($ftp,$curd,$k);
 @ftp_close($ftp);

 $p=trim($_GET['p']); $cnt=count($fls);
 $v=$skl; if (($v<1)||($v>100)) {$v=15;} $allp=ceil($cnt/$v);
 if (($p==NULL)||($p==0)) {$p=1;} elseif ($p>$allp) {$p=$allp;}
 $begin=$p*$v-$v; if ($begin>$cnt) {$begin=0;}
 $end=$begin+$v; if ($end>$cnt) {$end=$cnt;}
 for ($i=$begin;$i<$end;$i++) {$links.=$fls[$i]."<br/>\r\n";} $bl="";
 if ($p>1) {$v=$p-1; $bl.="<a href=\"ftp.php?k=$k&amp;d=$rd&amp;n=$rn&amp;p=$v\">prev.</a><br/>\r\n";}
 if ($allp>$p) {$v=$p+1; $bl.="<a href=\"ftp.php?k=$k&amp;d=$rd&amp;n=$rn&amp;p=$v\">next</a><br/>\r\n";}
 if ($bl<>NULL) {$bl="- - -<br/>page: $p/$allp<br/>$bl</small><input name=\"pg\" type=\"text\" value=\"$p\" size=\"3\" format=\"*N\"/><small><a href=\"ftp.php?k=$k&amp;d=$rd&amp;n=$rn&amp;p=$(pg)\">GO</a><br/>\r\n";}
$d=str_replace("\$","\$\$",$d); $n=str_replace("\$","\$\$",$n);
$curd=str_replace("\$","\$\$",$curd); $links=str_replace("\$","\$\$",$links);
echo("<p align=\"left\"><small>
$curd<br/>- - -<br/>");
if ($curd<>"/") {
 if ($ib==1) {
  $icn="<img src=\"icons/back.png\" width=\"16\" height=\"16\" alt=\"&lt;\"/>";
 } else {$icn="&lt;";}
 echo("$icn<a href=\"ftp.php?k=$k&amp;d=$back\">..</a><br/>");
}
echo("$links$bl");
if ($curd<>"/") {echo("- - -<br/>add to file list:[<a href=\"actn.php?k=$k&amp;d=$rd&amp;n=$rn&amp;ac=copy&amp;t=d&amp;go=1\">copy</a>][<a href=\"actn.php?k=$k&amp;d=$rd&amp;n=$rn&amp;ac=cut&amp;t=d&amp;go=1\">cut</a>]<br/>
<a href=\"arhdir.php?k=$k&amp;d=$rd&amp;n=$rn\">add to archive..</a><br/>
<a href=\"actn.php?k=$k&amp;d=$rd&amp;n=$rn&amp;ac=mv&amp;t=d\">move..</a><br/>
<a href=\"actn.php?k=$k&amp;d=$rd&amp;n=$rn&amp;ac=ren&amp;t=d\">rename</a><br/>
<a href=\"actn.php?k=$k&amp;d=$rd&amp;n=$rn&amp;ac=delf\">delete</a><br/>");}
echo("- - -<br/>
<a href=\"create.php?k=$k&amp;d=$rd&amp;n=$rn\">create..</a><br/>
<a href=\"list.php?k=$k&amp;d=$rd&amp;n=$rn\">file list</a><br/>
<a href=\"import.php?k=$k&amp;d=$rd&amp;n=$rn\">import file</a><br/>
<a href=\"upload.php?k=$k&amp;d=$rd&amp;n=$rn\">Upload</a>
</small></p>
</card></wml>");
} else {
echo("<p align=\"center\"><small>
connection error.<br/>
- - -<br/>
<anchor>back<prev/></anchor>
</small></p>
</card></wml>");//<a href=\"find.php?k=$k&amp;d=$rd&amp;n=$rn\">search</a>
}
?>
Return current item: FREE WAP PHP SCRIPTS CENTER