CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 1 of 1
  1. #1
    Join Date
    Jun 2017

    Registration form wont send data to phpmyadmin

    Hi, ive created a registration form but when i submit it, it wont send data to a table i created in php myadmin so i thnk i may have made a mistake somewhere. here is the code..

    HTML Code:
    require 'dbconfig/config.php';
    <!DOCTYPE html>
    <title>Registration Page</title>
    <link rel="stylesheet" href="css/style.css">
    <body style="background-color:#0c2177">
    <div id="main-wrapper">
    <h2>Registration Form</h2>
    <img src="images/avatar.png" class="avatar"/>
    <form class="loginform" action="register.php" method="POST">
    <label><b>First Name:<b></label><br>
    <input name="firstname" type="text" class="inputvalues" placeholder="Enter First Name" required/><br>
    <label><b>Last Name:<b></label><br>
    <input name="lastname" type="text" class="inputvalues" placeholder="Enter Last Name" required/><br>
    <label><b>Email Address:<b></label><br>
    <input name="email" type="email" class="inputvalues" placeholder="Enter Email Address" required/><br>
    <input name="password" type="password" class="inputvalues" placeholder="Enter Password" required/><br>
    <label><b>Confirm Password:<b></label><br>
    <input name="cpassword" type="password" class="inputvalues" placeholder="Confirm Password" required/><br>
    <input name="submit_btn" type="submit" id="signup_btn" value="Sign Up"/><br><br><br>
    <input type="button" id="back_btn" value="Back To Login Page"/>
    	echo '<script type"text/javascript"> alert("sign up button clicked") </script>';
    	$firstname = $_POST['firstname'];
    	$lastname = $_POST['lastname'];
    	$email = $_POST['email'];
    	$password = $_POST['password'];
    	$cpassword = $_POST['cpassword'];
    		$query= "select * from user WHERE email='$email'";
    		$query_run = mysqli_query($con,$query);
    			// this email address is already registered
    			echo '<script type="text/javascript"> alert("Email Address Already Registered") </script>';
    			$query= "insert into values('$firstname','$lastname','$email','$password','$cpassword')";
    			$query_run = mysqli_query($con,$query);
    			echo '<script type="text/javascript"> alert("Registration Successful.. return to login page") </script>';	
    			echo '<script type="text/javascript"> alert("ERROR!") </script>';	
    Last edited by 2kaud; June 13th, 2017 at 03:35 AM. Reason: Added code tags

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)