Advertisement
Guest User

Untitled

a guest
May 20th, 2018
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. <?php
  2. if(isset($_POST['submit'])) {
  3. $connection = mysqli_connect('localhost', 'root', 'root', 'uptest');
  4.  
  5. $url = $_POST['url'];
  6. $query = "INSERT INTO urls(url)";
  7. $query .= "VALUES ('$url')";
  8.  
  9. $result = mysqli_query($connection, $query);
  10. if(!$result){
  11. die(mysqli_error());
  12. }
  13. }
  14. ?>
  15. <!DOCTYPE html>
  16. <html lang="en">
  17. <head>
  18. <meta charset="UTF-8">
  19. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  20. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  21. <title>Document</title>
  22. </head>
  23. <body>
  24. <form action="index.php" method="POST">
  25. <input type="text" name="url" placeholder="Indtast URL">
  26. <input type="submit" value="submit">
  27. </form>
  28. </body>
  29. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement