<!DOCTYPE html> <html> <head> <meta charset="UTF-8" name="viewport" content="width=device-width, initial-scale=1"/> <link rel="stylesheet" type="text/css" href="css/bootstrap.css"/> </head> <body> <nav class="navbar navbar-default"> <div class="container-fluid"> <a class="navbar-brand" href="https://www.sourcecodester.com/">Sourcecodester.com</a> </div> </nav> <div class="col-md-3"></div> <div class="col-md-6 well"> <h3 class="text-primary">PHP - Simple Folder Generator</h3> <hr style="border-top:1px dotted #ccc;"/> <div class="col-md-4"> <form method="POST" action="generate.php"> <div class="form-group"> <label>Enter a text</label> <input type="text" name="folder" class="form-control"> </div> <button class="btn btn-primary" name="generate"><span class="glyphicon glyphicon-plus"></span> Generate</button> </form> </div> <div class="col-md-8"> <table class="table table-bordered"> <thead class="alert-info"> <tr> <th>Folder</th> <th>Full Location</th> </tr> </thead> <tbody> <?php foreach($files as $file){ if($file != "." && $file != ".."){ ?> <tr> <td><?php echo $file."<br />";?></td> </tr> <?php } } ?> </tbody> </table> </div> </div> </body> </html>
<?php $folder = $_POST['folder']; echo "<script>alert('You created ".$folder."!')</script>"; echo "<script>window.location='index.php'</script>"; } } ?>