Просмотр файла chmod.php

Размер файла: 2.25Kb
<?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=preg_replace("~.*/([^/]*)~m","\\1",$d);
$d=preg_replace("~(.*)/[^/]*~m","\\1",$d);} $sv=trim($_GET['sv']);
$t=trim($_GET['t']); $ch=trim($_GET['ch']);
$rd=rawurlencode($d); $rn=rawurlencode($n);
$d=str_replace(".|htaccess",".htaccess",$d);
$n=str_replace(".|htaccess",".htaccess",$n);

if (($sv<>1)||(strlen($ch)<>3)) {
$num=@file_get_contents("allnumbd.dat"); $nar=NULL;
$num++; $nar=$num; if ($num>99999999) {$num=0;}
$f=@fopen("allnumbd.dat","w"); @fwrite($f,$num); @fclose($f);
if ($d=="/") {$d="";} $n=str_replace("\$","\$\$",$n); $d=str_replace("\$","\$\$",$d);
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=\"Назад\"><prev/></do>");
echo("<p align=\"left\"><small>
$d/$n<br/>
- - -<br/>
CHMOD:</small>
<input name=\"ch".$nar."\" type=\"text\" value=\"$ch\" size=\"3\" maxlength=\"3\" format=\"*N\"/><small><br/>- - -<br/>
<a href=\"chmod.php?k=$k&amp;d=$rd&amp;n=$rn&amp;ch=$(ch".$nar.")&amp;sv=1\">Применить</a>
</small></p>
</card></wml>");
} else {
if (($ftp=@ftp_connect($sr))&&(@ftp_login($ftp,$lg,$ps))) {
 @ftp_pasv($ftp,true);
 $cmd="chmod 0$ch $d/$n"; @ftp_site($ftp,$cmd);
 @ftp_close($ftp);
 header("Location: $dftp/ftp.php?k=$k&d=$rd"); exit;
} else {
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)."\">");
echo("<p align=\"center\"><small>
Нет соединения с сервером.<br/>
- - -<br/>
<anchor>Назад<prev/></anchor>
</small></p>
</card></wml>");
}
}
?>