Guest User

Untitled

a guest
Jul 22nd, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.71 KB | None | 0 0
  1. <?php
  2.         //Getting user submitted data
  3.         $fname = $_POST["fname"];
  4.         $email = $_POST["email"];
  5.            
  6.         //Making a database connection
  7.         $mysqli = new mysqli("localhost", "filedragAdmin", "8adadyh98jd6a!", "filedragDB");
  8.        
  9.         if (mysqli_connect_errno())
  10.             {
  11.             //This is used if connection to the database fails.
  12.             printf("Connection to the server has failed");
  13.             exit();
  14.            
  15.             header("Location: servicedown.html");
  16.             }
  17.         else
  18.             {
  19.                 $sql = "INSERT INTO filedragTbl (fname, email) VALUES ($fname, $email)";
  20.                 $res = mysqli_query($mysqli,$sqli);
  21.                
  22.                 if ($res == TRUE)
  23.                 {
  24.                     header("Location: thankyou.html");
  25.                 }
  26.                 else
  27.                     {
  28.                     echo ("Sorry, shit has hit the fan");
  29.                     }
  30. ?>
Add Comment
Please, Sign In to add comment