Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $con = mysqli_connect('localhost','root','');
- $db= mysqli_select_db($con,'registration_form');
- //check connection
- if (!$con==TRUE){
- die("Connection failed: " . mysqli_connect_error());
- }
- if(isset($_POST['register_btn'])){
- $fullname = $_POST['fname'];
- $username = $_POST['user'];
- $email = $_POST['email'];
- $password = $_POST['passcode'];
- $cpass = $_POST['cpasscode'];
- $account = $_POST['accountname'];
- $accountnum = $_POST['accountno'];
- $name_of_bank = $_POST['bankname'];
- $phone_no = $_POST['phoneno'];
- //attempt insert query execution
- $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')";
- if(mysql_query($sql)){
- echo "account created successfully.";
- }
- else{
- echo "Error: Could not execute $sql. " . mysqli_error($con);
- }
- // Close connection
- mysqli_close($con);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement