Location: PHPKode > projects > FREE WAP PHP SCRIPTS CENTER > free_wap_ftp_client/file.php
<?php
error_reporting(0);
$k=trim($_GET['k']); include("key.php");
include_once("freedata.php"); freedata($k,0);
$d=rawurldecode(trim($_GET['d'])); $n=rawurldecode(trim($_GET['n']));
if ($d==NULL) {$d="";} elseif ($d=="/") {$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>
<head><meta forua=\"true\" http-equiv=\"Cache-Control\" content=\"no-cache,no-store,must-revalidate\"/></head><card title=\"FTP - ".strtoupper($lg)."\"><do name=\"back\" type=\"options\" label=\"back\"><prev/></do>\r\n");

if (($ftp=@ftp_connect($sr))&&(@ftp_login($ftp,$lg,$ps))) {
@ftp_pasv($ftp,true);
$sz=@ftp_size($ftp,"$d/$n");
$tm=@ftp_mdtm($ftp,"$d/$n");
@ftp_close($ftp);

$fsz=$sz;
if ($sz<1024) {$sz="$sz bytes";}
elseif (($sz>=1024)&&($sz<1048576)) {$sz=strtr(round($sz/1024,2),".",",")." kb";}
elseif ($sz>=1048576) {$sz=strtr(round($sz/1024/1024,2),".",",")." mb";}

if ($tm<>NULL) {$tmv=date("d.m.y, H:i:s",$tm);} else {$tmv="-";}
$d=str_replace("\$","\$\$",$d); $n=str_replace("\$","\$\$",$n);
$rf=strtolower(preg_replace("~.*\.([^.]*)~m","\\1",$n));
echo ("<p align=\"left\"><small>
<a href=\"ftp.php?k=$k&amp;d=$rd\">$d/</a>$n<br/>
- - -<br/>
Size: $sz<br/>
Last edited: ".$tmv."<br/>\r\n");

if ((($rf=="zip")||($rf=="jar")||($rf=="tar")||($rf=="tgz")||($rf=="gz")||($rf=="gz2")||($rf=="bz")||($rf=="bz2")||($rf=="tbz")||($rf=="tbz2")||($rf=="tgz2"))&&($fsz<=716800)&&($fsz>0)) {echo("- - -<br/><a href=\"openarh.php?k=$k&amp;d=$rd&amp;n=$rn&amp;tp=$rf\">open..</a><br/>");
if (($rf=="zip")||($rf=="jar")) {echo("<a href=\"zip.php?k=$k&amp;d=$rd&amp;n=$rn&amp;act=ext\">unzip</a><br/>");}
elseif (($rf=="tar")||($rf=="tgz")||($rf=="gz")||($rf=="gz2")||($rf=="bz")||($rf=="bz2")
||($rf=="tbz")||($rf=="tbz2")||($rf=="tgz2")) {echo("<a href=\"tgz.php?k=$k&amp;d=$rd&amp;n=$rn&amp;ac=ext\">unzip</a><br/>");}}
if (($rf<>"jpg")&&($rf<>"jpeg")&&($rf<>"jpe")&&($rf<>"png")&&($rf<>"gif")&&($rf<>"bmp")&&($rf<>"dll")&&($rf<>"wav")&&($rf<>"mid")&&($rf<>"midi")&&($rf<>"mp3")&&($rf<>"mmf")&&($rf<>"psd")&&($rf<>"doc")&&($rf<>"pdf")&&($rf<>"zip")&&($rf<>"rar")&&($rf<>"jar")&&($rf<>"3gp")&&($rf<>"avi")&&($rf<>"mp4")&&($rf<>"class")&&($rf<>"tgz")&&($rf<>"gz")&&($rf<>"bz")&&($rf<>"gz2")&&($rf<>"bz2")&&($rf<>"tbz")&&($rf<>"tbz2")&&($rf<>"tgz2")&&($rf<>"tar")&&($fsz<=122880)) {
echo("- - -<br/><a href=\"edit.php?k=$k&amp;d=$rd&amp;n=$rn&amp;ed=1&amp;msz=$(msz)&amp;kdr=$(kdr)&amp;ln=$(ln)\">edit</a>&nbsp;
[<a href=\"edit2.php?k=$k&amp;d=$rd&amp;n=$rn&amp;ed=1&amp;msz=$(msz)&amp;kdr=$(kdr)&amp;ln=$(ln)\">2.0</a>]<br/>
Lines in page(1-15):</small><input name=\"ln\" type=\"text\" value=\"7\" maxlength=\"2\" size=\"2\" format=\"*N\"/><small><br/>
Symbols in line(32-1024):</small><input name=\"msz\" type=\"text\" value=\"0\" maxlength=\"4\" size=\"4\" format=\"*N\"/><br/>
<small>encoding:</small><select name=\"ikdr\" value=\"2\">
<option value=\"1\">Koi8-R</option>
<option value=\"2\">other</option>
</select><br/>
<small>save as:</small><select name=\"kdr\" value=\"1\">
<option value=\"1\">UTF-8</option>
<option value=\"2\">Windows-1251</option>
<option value=\"3\">Escape(Unicode)</option>
<option value=\"4\">Koi8-R</option>
<option value=\"5\">dont change</option>
</select><br/><small>");
}
if (($rf=="txt")&&($fsz<=204800)) {echo("- - -<br/><a href=\"book.php?k=$k&amp;d=$rd&amp;n=$rn\">create book</a><br/>");}
if (($rf=="sql")&&($fsz<=204800)) {echo("- - -<br/><a href=\"inst.php?k=$k&amp;d=$rd&amp;n=$rn\">create sql setup wizard</a><br/>");}
echo("- - -<br/>add to list:<br/>[<a href=\"actn.php?k=$k&amp;d=$rd&amp;n=$rn&amp;ac=copy&amp;t=f&amp;go=1\">copy</a>][<a href=\"actn.php?k=$k&amp;d=$rd&amp;n=$rn&amp;ac=cut&amp;t=f&amp;go=1\">cut</a>]");
if (($rf<>"zip")&&($rf<>"jar")&&($rf<>"rar")&&($rf<>"tgz")&&($rf<>"gz")&&($rf<>"bz")&&($rf<>"gz2")&&($rf<>"bz2")&&($rf<>"tbz")&&($rf<>"tbz2")&&($rf<>"tgz2")&&($rf<>"tar")&&($fsz<=3145728)) {echo("[<a href=\"actn.php?k=$k&amp;d=$rd&amp;n=$rn&amp;ac=arh&amp;t=f&amp;go=1\">ZIP</a>][<a href=\"actn.php?k=$k&amp;d=$rd&amp;n=$rn&amp;ac=at&amp;t=f\">TAR</a>]<br/>");}
else {echo("<br/>");}
if (($rf<>"zip")&&($rf<>"jar")&&($rf<>"rar")&&($rf<>"tgz")&&($rf<>"gz")&&($rf<>"bz")&&($rf<>"gz2")&&($rf<>"bz2")&&($rf<>"tbz")&&($rf<>"tbz2")&&($rf<>"tgz2")&&($rf<>"tar")&&($fsz<=3145728)) {echo("add to archive:<br/>[<a href=\"ecopy.php?k=$k&amp;d=$rd&amp;n=$rn&amp;tp=a\">ZIP</a>][<a href=\"ecopy.php?k=$k&amp;d=$rd&amp;n=$rn&amp;tp=t\">TAR</a>]<br/>");}
echo("<a href=\"ecopy.php?k=$k&amp;d=$rd&amp;n=$rn&amp;tp=c\">copy..</a><br/>
<a href=\"ecopy.php?k=$k&amp;d=$rd&amp;n=$rn&amp;tp=m\">move..</a><br/>");
echo("<a href=\"actn.php?k=$k&amp;d=$rd&amp;n=$rn&amp;ac=ren&amp;t=f\">rename</a><br/>
<a href=\"actn.php?k=$k&amp;d=$rd&amp;n=$rn&amp;ac=del&amp;t=f\">delete</a>
</small></p>
</card></wml>");
} else {
echo("<p align=\"center\"><small>
error.<br/>
- - -<br/>
<anchor>back<prev/></anchor>
</small></p>
</card></wml>");
}
?>
Return current item: FREE WAP PHP SCRIPTS CENTER