Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //Getting user submitted data
- $fname = $_POST["fname"];
- $email = $_POST["email"];
- //Making a database connection
- $mysqli = new mysqli("localhost", "filedragAdmin", "8adadyh98jd6a!", "filedragDB");
- if (mysqli_connect_errno())
- {
- //This is used if connection to the database fails.
- printf("Connection to the server has failed");
- exit();
- header("Location: servicedown.html");
- }
- else
- {
- $sql = "INSERT INTO filedragTbl (fname, email) VALUES ($fname, $email)";
- $res = mysqli_query($mysqli,$sqli);
- if ($res == TRUE)
- {
- header("Location: thankyou.html");
- }
- else
- {
- echo ("Sorry, shit has hit the fan");
- }
- ?>
Add Comment
Please, Sign In to add comment