I try to insert a register form in my code but i broke always my template. Where i must but the code in the right way? i found a register script and i wanna push it inside. in the input tags i add the id flags but this destroyed every time my template
<div class="loginbox-or">
<div class="or-line"></div>
<div class="or">OR</div>
</div>
<div class="form-group">
<label>Email: <span class="required">*</span></label>
<input placeholder="" class="form-control" type="email">
</div>
<div class="form-group">
<label>Password: <span class="required">*</span></label>
<input placeholder="" class="form-control" type="password">
</div>
<div class="form-group">
<label>Confirm Password: <span class="required">*</span></label>
<input placeholder="" class="form-control" type="password">
</div>
<div class="loginbox-forgot">
<input type="checkbox"> I accept <a href="">Term and consitions?</a>
</div>
<div class="loginbox-submit">
<input type="button" class="btn btn-default btn-block" value="Register">
</div>
<div class="loginbox-signup"> Already have account <a href="login.html">Sign in</a> </div>
</div>
</div>
</div>
</div>
</div>
</section>
<script type="text/javascript">
$(".full-page").height($(window).height());
$(window).resize(function() {
$(".full-page").height($(window).height());
});
</script>
</div>
</body>
here i downloaded my register script.
<div class="signin-form">
<div class="container">
<form class="form-signin" method="post" id="register-form">
<h2 class="form-signin-heading">Sign Up</h2><hr />
<div id="error">
</div>
<div class="form-group">
<input type="email" class="form-control" placeholder="Email address" name="user_email" id="user_email" />
<span id="check-e"></span>
</div>
<div class="form-group">
<input type="password" class="form-control" placeholder="Password" name="password" id="password" />
</div>
<div class="form-group">
<input type="password" class="form-control" placeholder="Retype Password" name="cpassword" id="cpassword" />
</div>
<hr />
<div class="form-group">
<button type="submit" class="btn btn-default" name="btn-save" id="btn-submit">
<span class="glyphicon glyphicon-log-in"></span> Create Account
</button>
PHP-PART
<?php
require_once 'dbconfig.php';
if($_POST)
{
$user_email = mysql_real_escape_string($_POST['user_email']);
$user_password = mysql_real_escape_string($_POST['password']);
$joining_date = date('Y-m-d H:i:s');
//password_hash see : http://www.php.net/manual/en/function.password-hash.php
$password = password_hash( $user_password, PASSWORD_BCRYPT, array('cost' => 11));
try
{
$stmt = $db_con->prepare("SELECT * FROM tbl_users WHERE user_email=:email");
$stmt->execute(array(":email"=>$user_email));
$count = $stmt->rowCount();
if($count==0){
$stmt = $db_con->prepare("INSERT INTO tbl_users(user_email,user_password,joining_date) VALUES(:email, :pass, :jdate)");
$stmt->bindParam(":email",$user_email);
$stmt->bindParam(":pass",$password);
$stmt->bindParam(":jdate",$joining_date);
if($stmt->execute())
{
echo "registered";
}
else
{
echo "Query could not execute !";
}
}
else{
echo "1"; // not available
}
}
catch(PDOException $e){
echo $e->getMessage();
}
}
?>