Advertisement
Guest User

Untitled

a guest
Jan 29th, 2017
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.85 KB | None | 0 0
  1. <?php
  2. $con = mysqli_connect('localhost','root','');
  3. $db= mysqli_select_db($con,'registration_form');
  4.  
  5. //check connection
  6.  
  7. if (!$con==TRUE){
  8. die("Connection failed: " . mysqli_connect_error());
  9.  
  10. }
  11. if(isset($_POST['register_btn'])){
  12.  
  13. $fullname = $_POST['fname'];
  14. $username = $_POST['user'];
  15. $email = $_POST['email'];
  16. $password = $_POST['passcode'];
  17. $cpass = $_POST['cpasscode'];
  18. $account = $_POST['accountname'];
  19. $accountnum = $_POST['accountno'];
  20. $name_of_bank = $_POST['bankname'];
  21. $phone_no = $_POST['phoneno'];
  22.  
  23. //attempt insert query execution
  24.  
  25. $sql = "INSERT INTO sitemembers (fullname, userName, email, passcode, cpasscode, accountName, accountNo, nameOfbank, phoneNo) VALUES ('$fullname','$username','$email','$password','$cpass','$account','$accountnum','$name_of_bank','$phone_no')";
  26.  
  27.  
  28. if(mysql_query($sql)){
  29. echo "account created successfully.";
  30.  
  31. }
  32. else{
  33. echo "Error: Could not execute $sql. " . mysqli_error($con);
  34. }
  35.  
  36. // Close connection
  37. mysqli_close($con);
  38.  
  39. }
  40. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement