Hi I am creating a registration page for my website but having a few problems. Can anyone please have a look at my code and see where I am going wrong please. I am working on Xampp.
I followed a step by step tutorial and no matter what I do when I register it just refuses to add my data in phpMyAdmin. When I complete thre registration form it goes to the regprocess.php page which just gives me a white blank page. There are no data being inserted at all. Also can you confirm with me if I can just add password2 for Confirm Password or what else do I need.
Please find my code below and a screen shot of my users table.
Thanks
Register.php
<div class="content">
<div id="formWrap">
<h1>Register</h1>
<div id="form">
<form action="regprocess.php" method="post" id = "register_form" >
<div class="row">
<div class="label">Username</div>
<!-- end .label -->
<div class="input">
<input type="text" id="username" class="detail" name="username"/>
</div>
<!-- end .input -->
<div class="context">Only letters and numbers are allowed</div>
<!-- end .context -->
</div>
<!-- end .row -->
<div class="row">
<div class="label">Email</div>
<!-- end .label -->
<div class="input">
<input type="email" id="email" class="detail" name="email"/>
</div>
<!-- end .input -->
<div class="context">We will not share your email with anyone or spam you with messages either</div>
<!-- end .context -->
</div>
<!-- end .row -->
<div class = "row">
<div class = "label">First Name</div>
<!--end.label-->
<div class = "input">
<input type = "text" id = "fullname" class ="detail" name ="fname"/>
</div>
<!-- end .input -->
<div class="context">e.g. Richard John</div>
<!-- end .context -->
</div>
<!-- end .row -->
<div class="row">
<div class="label">Last Name</div>
<!-- end .label -->
<div class="input">
<input type="text" id="lastname" class="detail" name="lname"/>
</div>
<!-- end .input -->
<div class="context">Wakefield</div>
<!-- end .context -->
</div>
<!-- end .row -->
<div class="row">
<div class="label">Password</div>
<!-- end .label -->
<div class="input">
<input type="password" id="pass1" class="detail" name="password"/>
</div>
<!-- end .input -->
<div class="context">Must be between 6 and 20 characters long, with at least one lowercase letter, one uppercase letter, and one number</div>
<!-- end .context -->
</div>
<!-- end .row -->
<div class="submit">
<input type="submit" id="submit" name="submit" value="Register"/>
</div>
<!-- end .submit -->
</form>
<!-- end #form -->
</div>
</div>
<!-- end formWrap -->
</div>
regprocess.php
<?php
include "config.php";
$username = $_POST['username'];
$email = $_POST['email'];
$fname = $_POST['fname'];
$lname = $_POST['lname'];
$password = md5($_POST['password']);
$insert = 'INSERT into users(username, email, fname, lname, password) VALUES("'.$username.'","'.$email.'","'.$fname.'","'.$lname.'","'.$password.'")';
mysql_query($insert);
?>
config.php
<?php
$localhost = "localhost";
$dbuser = "root";
$dbpass = "admin";
$dbname = "mystore";
$connect = mysql_connect($localhost, $dbuser, $dbname);
mysql_select_db("$dbname", $connect);
?>
Thanks