Файл: chck2.php
Строк: 70
<?php
error_reporting(0);
$sid=trim($_GET['sid']);
$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);}
$mr=trim($_GET['mr']); $error=0;
$rd=rawurlencode($d); $rn=rawurlencode($n);
$d=str_replace(".|htaccess",".htaccess",$d);
$n=str_replace(".|htaccess",".htaccess",$n);
$title="Checking Script";
include("inc/head.php");
echo "<div class="bmenu" align="left"><b>
Checking script</b></div><div class="list2" style="background-color:#eeeeee">";
if (file_exists("data/$k.ed")) {
@exec($php.' -c -f -l "data/'.$k.'.ed"',$rt,$v); $erl=0;
if (($v==255)||(count($rt)==3)) {
echo("Host not support: "); $st=trim(strip_tags($rt[1])); $error=1;
if ($st<>NULL) {
$srp=trim(preg_replace("~[^:]*:(.*)(in [^s]*data/".$k.".ed).*~","\1",$st,1));
echo str_replace("$k.ed","",$srp);
$st=str_replace("$k.ed","",$st);
$erl=preg_replace("~.*s(d*)$~","\1",$st,1);
if ($erl<>NULL) {
$pg=ceil($erl/15);
echo("<br>rn <font color='red'>Lines to page: $erl; pages: $pg</font>");
}
} else {echo("Host not support..!!");}
echo("<br><hr/><br>rn");
} elseif ($v===0) {
$error=2;
echo("No syntax errors detected..!!<br><hr/><br>rn");
}
if (($error==1)||($mr==1)) {
$fl=str_replace("n","",trim(file_get_contents("data/$k.ed")));
$fl=highlight_string($fl,true);
$fl=str_replace(array('<code>','</code>','</span>'),array('','','</font>'),$fl);
$fl=str_replace('span style="color: ','font color="',$fl);
$arr=split("r",$fl); $cnt=count($arr);
if ($mr==1) {$begin=0; $end=$cnt;}
else {$begin=$erl-2; $end=$erl+1; if ($begin<0) {$begin=0;} if ($end>$cnt) {$end=$cnt;}}
for ($i=$begin;$i<$end;$i++) {
if ($i==$erl-1) {$fcl="bd0000"; $bcl="75bf00";} else {$fcl="58a400"; $bcl="586776";}
echo("<span style="color:#$fcl;">".($i+1)." </span>".$arr[$i]."<br/><br/>rn");
}
} elseif ($error<>2) {echo("No syntax errors detected..!!<br/>
<hr/><br/><a href="chck2.php?k=$k&mr=1">Show all lines</a><br/><br/>rn");}
} else {echo("File not found..!!<br/><br/>rn");}
if (($mr<>1)&&($error<>0)) {
if ($error==1) {echo("<hr/><br/><a href="chck.php?k=$k&mr=1">Checking syntax</a><br/>");}
else {echo("<a href="chck2.php?k=$k&mr=1">Show all lines</a><br/>");}
}
echo("</small></div>");
include("inc/foot.php");
?>