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

Размер файла: 1.99Kb
<?php
// making by  ...Smith...
require_once "../includes/start.php";
require_once "../includes/functions.php";
require_once "../includes/header.php";
include_once "../themes/".$config['themes']."/index.php";

$fe = str_replace ("http://", "", $home);
$arand = rand(0, 99999);

switch ($_GET["s"])
{
case 'scan':
$f = stripslashes(trim($_POST["url"]));
$input = htmlspecialchars(stripslashes(trim($_POST["input"])));
$file = @file_get_contents($f);
if (!$f)
{
echo "Вы не ввели адрес - <a href=\"index.php\">Еще раз";
}else{
$url = str_replace("https", "http", $f);
if(!preg_match('#^(http\:\/\/){1}[-a-z0-9_\.]+[-a-z0-9_\.]+[_-a-Z0-9\.]?#i', $url))
{
echo "Адрес имеет не верный формат! Адрес может начинаться только с http://";
}else{
echo "Код:<br />";
if ($input == "yes")
{
}else{
echo "<form action=\"index.php?s=scanage\" method=\"post\">";
}
echo "<textarea cols=\"50\" rows=\"30\" name=\"age\">$file</textarea><br />";
if ($input == "yes")
{
$fo = fopen ("files/$arand.txt", "w+");
$str = "$file";
fputs ($fo,$file);
echo "<a href=\"files/$arand.txt\">Скачать txt</a>";
}else{
echo "<input type=\"submit\" value=\"Сохранить txt\">";
echo "</form>";
}
}
}
break;

case 'scanage':
$age = stripslashes(trim($_POST["age"]));
$fo = fopen ("files/$arand.txt", "w+");
$str = "$age";
fputs ($fo,$age);

echo "Код:";
echo "<textarea cols=\"50\" rows=\"30\" name=\"age\">$age</textarea><br />";
echo "<a href=\"files/$arand.txt\">Скачать txt</a>";
break;

default:
echo "Сканер сайтов:<br />";
echo "
<form action=\"index.php?s=scan\" method=\"post\">
Адрес:<br />
<input type=\"text\" name=\"url\" value=\"http://\"><br />
Сохранить в файл&nbsp;
<input type=\"checkbox\" name=\"input\" value=\"yes\"><br />
<input type=\"submit\" value=\"Скан\">
</form>
";
break;
}
include_once "../themes/".$config['themes']."/foot.php";

?>