window.open('login.html','_self')"; } ?> Web Archive | Shalin Zulkifli and TSP Tun Dr. Zeti Akhtar Aziztitle> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script> </head> <body> <br><br> <div class="container"> <h2>Add New Content</h2> <form action="" method="post" enctype="multipart/form-data"> <div class="form-group"> <label>Title</label> <input type="text" class="form-control" placeholder="Enter title" name="title"> </div> <div class="form-group"> <label>Crawled Page</label> <input type="text" class="form-control" placeholder="Enter a Crawled Page" name="crawledpage"> </div> <div class="form-group"> <label>Size</label> <input type="text" class="form-control" placeholder="Enter a size" name="size"> </div> <div class="form-group"> <label>Link</label> <input type="text" class="form-control" placeholder="Enter link of video" name="view"> </div> <input type="submit" name="insert-btn" class="btn btn-primary"> </form> <?php $conn = mysqli_connect ('localhost','root','','web archive'); if (isset($_POST['insert-btn'])){ $title = $_POST['title']; $crawledpage = $_POST['crawledpage']; $size = $_POST['size']; $view = $_POST['view']; $insert = "INSERT INTO content(title,crawledpage,size,view) VALUES('$title','$crawledpage','$size','$view')"; $run_insert = mysqli_query($conn,$insert); if($run_insert === true){ echo "<script>window.open('display_data.html','_self');</script>"; }else{ echo "Failed. Try again"; } } ?> </div> </body> </html>