Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature may not be available in some browsers.
<!DOCTYPE html>
<html>
    <head>
        <title>
            Form erstellt Domain
        </title>
        <meta charset="utf-8">
        <style>
            html, body, * {
                padding: 0;
                margin: 0;
            }
           
            .main {
                display: flex;
                justify-content: center;
                align-items: center;
                width: 100vW;
                height: 100vH;
            }
           
            input[name="name"] {
                width: 50vW;
                height: 40px;
                border: 1px solid black;
                padding-left: 13px;
                font-size: 20px;
            }
           
            input:focus, button:focus {
                outline: none;
            }
           
            button[type="submit"] {
                border: 1px solid black;
                background-color: white;
                color: black;
                padding: 10px 20px;
                font-size: 20px;
                margin-top: 10px;
            }
           
            button[type="submit"]:hover {
                background-color: black;
                color: white;
            }
        </style>
    </head>
    <body>
        <div class="main">
            <form method="post" action="HIER_DER_NAME_DER_PHP_DATEI_WO_DIE_ABFRAGE_GEMACHT_WIRD.php">
                <input type="text" name="name" id="name" required="" autocomplete="off"><br>
               
                <button name="submit" type="submit">Submit</button>
            </form>
        </div>
    </body>
</html><!DOCTYPE html>
<html>
    <head>
        <title>
            Form erstellt Domain
        </title>
        <meta charset="utf-8">
        <script src="https://code.jquery.com/jquery-3.2.1.js"></script>
        <style>
            html, body, * {
                padding: 0;
                margin: 0;
                font-family: Arial;
            }
            .main {
                display: flex;
                justify-content: center;
                align-items: center;
                width: 100vW;
                height: 100vH;
                flex-flow: column;
            }
            input[name="name"] {
                width: 50vW;
                height: 40px;
                border: 1px solid black;
                padding-left: 13px;
                font-size: 20px;
            }
            input:focus, button:focus {
                outline: none;
            }
            button[type="submit"] {
                border: 1px solid black;
                background-color: white;
                color: black;
                padding: 10px 20px;
                font-size: 20px;
                margin-top: 10px;
            }
            button[type="submit"]:hover {
                background-color: black;
                color: white;
            }
        </style>
    </head>
    <body>
        <div class="main">
            <form method="post">
                <input type="text" name="name" id="name" required="" autocomplete="off"><br>
                <button name="submit" type="submit" onclick="return SendDataANM()">Submit</button>
            </form><br>
            <p style="height: 30px;" id="msg"></p>
        </div>
        <script>
            function SendDataANM()
            {
                var name = document.getElementById('name').value;               
                var dataString = 'name=' + name;
                $.ajax({
                    type: "post",
                    url: "create_site.php",
                    data: dataString,
                    cache: false,
                    success: function (html) {
                        $('#msg').html(html);
                    }
                });
                return false;
            }
        </script>
    </body>
</html><?php
//Wir kriegen den eingegebenen Namen des HTML-FORMS geliefert
$name = $_POST['name'];
//Hier die Abfrage, ob das Feld leer ist, oder nicht dem Muster entspricht
if ($name == '') {
    echo "Bitte fülle das Feld aus";
} else if (!preg_match("/^[a-zA-Z ]*$/", $name)) { //Hier wird vorgegeben, dass NUR BUCHSTABEN und LEERZEICHEN, aber KEINE ZAHLEN oder SONDERZEICHEN benutzt werden dürfen
    echo "Du benutzt unzulässige Zeichen";
} else { //Wenn keiner der beiden Fälle oben zutrifft (also alles okay ist) dann mache das hier
    $vorlage = fopen("vorlage.php", "r");
    $read_vorlage = fread($vorlage, filesize("vorlage.php"));//Wir lesen den HTML-Code aus der Datei "vorlage.php" aus.
   
    $datei = fopen("$name.php", "w"); 
    echo fwrite($datei, "$read_vorlage");//Hier schreiben wir den ausgelesenen HTML-Code von "vorlage.php" in unsere neu erstellte Datei.
    fclose($datei);
    fclose($vorlage);
   
   
    ?>
    <meta http-equiv="refresh" content="0; URL=<?php echo "$name"; ?>"><!--Weiterleitung auf die neue Seite-->
    <?php
}<!DOCTYPE html>
<html>
    <head>
        <title>
            Blabla
        </title>
    </head>
    <body>
        Guck mal in die URL und schau, ob es funktioniert hat!
    </body>
</html>RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.html [NC,L]