<?php
if($_POST){
$r=range(100, 999);
shuffle($r);
$r1=$r[0];
$r1=$_POST['do'];
$do_more=$_POST['do_more']?$_POST['do_more']:'';
$r11=$r1;
$web="www.".$r1.".com";
$web2="http://www.".$r1.".com";
// var_dump($r);die;
$str2="127.0.0.1 ".$web."
";
$file = 'C:WindowsSystem32driversetchosts';
$file2 = 'D:wampinapacheapache2.4.9confextrahttpd-vhosts.conf';
// $file2 = 'D:AppServApache24confextrahttpd-vhosts.conf';
file_put_contents($file, $str2, FILE_APPEND);
if($_POST['do_more']){
$r11=$r1."\".$do_more;
}
$str = file_get_contents($file);
$str3="<VirtualHost *:80>
";
$str3.=" DocumentRoot "D:\admin\".$r11.""
";
$str3.=" ServerName www.".$r1.".com
";
$str3.=" ServerAlias www.".$r1.".com
";
$str3.=" <Directory "D:admin\".$r11."">
";
$str3.=" Options FollowSymLinks ExecCGI
";
$str3.=" AllowOverride All
";
$str3.=" Order allow,deny
";
$str3.=" Allow from all
";
$str3.=" Require all granted
";
$str3.=" </Directory>
";
$str3.="</VirtualHost>
";
file_put_contents($file2, $str3, FILE_APPEND);
$res = file_get_contents($file2);
echo "<a href='".$web2."'>$web2</a>";echo "<a href='javascript:history.go(-1);'> 返回</a>";
// echo $res;
}
/*
最简单的爬网页程序
*/
?>
<html lang="zh" dir="ltr">
<head>
<meta charset="utf-8">
<meta name="google" value="notranslate">
<meta name="referrer" content="strict-origin">
</head>
<body>
<div style="980px; margin:0 auto">
<form action="" method="post">
<table border=1>
<td>domain</td><td><input type="text" name='do'/></td><td><input type="text" name='do_more'/></td><td><input type="submit" name='submit'/></td>
</table>
</form>
</div>
</body>
</html>