Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $servername = "localhost";
- $dbusername = "root";
- $dbpassword = "";
- $dbname = "signup";
- $fname = $_POST['fname'];
- $lname = $_POST['lname'];
- $email = $_POST['email];
- $conn = new mysqli($servername, $dbusername, $dbpassword, $dbname);
- if ($conn->connect_error) {
- die("Connection failed: " . $connect_error);
- }
- if(empty($fname)){
- echo "first name can not be blank. Please press back and put a name";
- die();
- }
- if(empty($lname)){
- echo "last name can not be blank. Please press back and put a name";
- die();
- }
- if(empty($email)){
- echo "email name can not be blank. Please press back and put a email";
- die();
- }
- $sql= "INSERT INTO signupform (First_Name ,Last_Name ,Email)
- VALUES('$fname','$lname','$email')"; this is the line 33
- if ($conn->query($sql) == TRUE){
- echo"Thank you ! your info has been entered into our database you may close the window now.";
- }
- else{
- echo"Error: " .sql ."<br" . $conn->error;
- $conn->error();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement