Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(isset($_POST['submit'])) {
- $connection = mysqli_connect('localhost', 'root', 'root', 'uptest');
- $url = $_POST['url'];
- $query = "INSERT INTO urls(url)";
- $query .= "VALUES ('$url')";
- $result = mysqli_query($connection, $query);
- if(!$result){
- die(mysqli_error());
- }
- }
- ?>
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta http-equiv="X-UA-Compatible" content="ie=edge">
- <title>Document</title>
- </head>
- <body>
- <form action="index.php" method="POST">
- <input type="text" name="url" placeholder="Indtast URL">
- <input type="submit" value="submit">
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement