生成新站点
2021/8/29 6:06:40
本文主要是介绍生成新站点,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
<?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."\n";
$file = 'C:\Windows\System32\drivers\etc\hosts';
$file2 = 'D:\wamp\bin\apache\apache2.4.9\conf\extra\httpd-vhosts.conf';
// $file2 = 'D:\AppServ\Apache24\conf\extra\httpd-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>\n";
$str3.=" DocumentRoot \"D:\\admin\\".$r11."\"\n";
$str3.=" ServerName www.".$r1.".com\n";
$str3.=" ServerAlias www.".$r1.".com\n";
$str3.=" <Directory \"D:\admin\\".$r11."\">\n";
$str3.=" Options FollowSymLinks ExecCGI\n";
$str3.=" AllowOverride All\n";
$str3.=" Order allow,deny\n";
$str3.=" Allow from all\n";
$str3.=" Require all granted\n";
$str3.=" </Directory>\n";
$str3.="</VirtualHost>\n";
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="width: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>
这篇关于生成新站点的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-11-23Springboot应用的多环境打包入门
- 2024-11-23Springboot应用的生产发布入门教程
- 2024-11-23Python编程入门指南
- 2024-11-23Java创业入门:从零开始的编程之旅
- 2024-11-23Java创业入门:新手必读的Java编程与创业指南
- 2024-11-23Java对接阿里云智能语音服务入门详解
- 2024-11-23Java对接阿里云智能语音服务入门教程
- 2024-11-23JAVA对接阿里云智能语音服务入门教程
- 2024-11-23Java副业入门:初学者的简单教程
- 2024-11-23JAVA副业入门:初学者的实战指南