zoukankan      html  css  js  c++  java
  • 生成新站点

    <?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>

  • 相关阅读:
    微信小程序、支付宝小程序、H5根据字符串生成相同的二维码
    大文件排序优化实践
    Nginx(五):http反向代理的实现
    Nginx(四):http服务器静态文件查找的实现
    关于大数据技术的一点思考
    Nginx(三):http模块的处理流程解析之正向代理
    基于Prometheus网关的监控完整实现参考
    谈谈mysql和oracle的使用感受 -- 差异
    Nginx(二): worker 进程处理流程框架解析
    退避算法实现之:客户端优雅回调
  • 原文地址:https://www.cnblogs.com/csjoz/p/15201762.html
Copyright © 2011-2022 走看看