Sign Up

sign.php

<?php
include ("config.php")
?>
<!DOCTYPE html>
<html>
<head>
<title>
To Fill the Registration Form
</title>
<link rel="stylesheet" type="text/css" href="style.css">
<script src="jquery-3.2.1.min.js"></script>
<script>
$(document).ready(function(){
$("#p2").bind("blur",password_check)
}
);
function password_check()
{
var p1=$("#p1").val();
var p2=$("#p2").val();
if(p1!=p2)
{
$("#pass_err").html("mismatch password");
}
else{
$("#pass_crr").html("correct password");
}
}
</script>
</head>
<body>
<div id="header"></div>
<div id="nav">
<center>
<ul id="navul">
<li><a href="#">Home</a></li>
<li><a href="#">product</a></li>
<li><a href="#">download</a></li>
<li><a href="#">About us</a></li>
<li><a href="#">Contact Us</a></li>
<li><a href="fileupload.php">fileupload</a></li>
<li><a href="sign.php">Sign</a><li>
<li><a href="logout.php">logout</a></li>
</ul>
</center>
</div>
<div id="container">
<div id="lftbx">
</div>
<div id="rtbx"></div>
<h1>Sign In</h1>
<fieldset id="user_login">
<legend>User Login</legend>
<form method="post" action="sign.php">
<table id="user_table">
<tr><td>Name</td>
<td><input type="text" name="name"></td>
</tr>
<tr><td>Username</td>
<td><input type="text" name="uname"></td>
</tr><tr><td>Email</td>
<td><input type="text" name="email"></td>
</tr><tr><td>Password</td>
<td><input type="password" id="p1" name="pass1"></td>
<td><i class="error" id="pass_err"></li>
<i class="correct" id="pass_crr"></li></td>
</tr><tr><td>Conform Password</td>
<td><input type="password" id="p2" name="pass2"></td>
</tr>
<tr><td>Question</td>
<td>
<select name="question">
<option value="What is your fav color?">What is your fav color?
</option>
<option value="What is your fav pet?">What is your fav pet?
</option>
<option value="What is your fav bike?">What is your fav bike?
</option>
<option value="what is your fav car?">what is your fav car?
</option>
</select>
</td>
</tr>
<tr><td>Answer</td>
<td><input type="text" name="answer"></td>
</tr>
<tr>
<td><input type="submit" id="sbtn" value="save" name="submit"></td>
<td><input type="reset" id="rbtn" value="clear"></td>
</tr>
<tr><td></td>
<td><a href="login.php">Already User?</a></td>
</tr>
</table>
</form>
</fieldset>
<?php

  if(isset($_POST["submit"]))
  {
 $name=$_POST["name"];
 $uname=$_POST["uname"];
 $email=$_POST["email"];
 $pass1=$_POST["pass1"];
 $pass2=$_POST["pass2"];
 $question=$_POST["question"];
 $answer=$_POST["answer"];
if($name!=""&& $uname!==""&&$email!=""&&$pass1!=""&&$pass2!=""&&$question!=""&&$answer!="")
{
if($pass1==$pass2)
{
$sql="INSERT into user(name,uname,email,password,question,answer)values('$name','$uname','$email','$pass1','$question','$answer')";
if($con->query($sql))
{
echo "<p class='correct'> You Are a Member...</p>";
}
else{

echo "<p class='error'>some error try again later</p>";
}

}
else{
echo "<p class='correct'>Comform Password Must be same</p>";
}
  }
  else
  {
 echo "<p>Please Fill all the message</p>";
  }
  }
?>
</div>
<div id="footer">
<center>copyright &copy;| Designed by Muthukumar
</center>
</div>
</body>
</html>


style.css

*{
margin:0px;
padding:0px;
}
html
{
background:#666;
}
body
{
background:blue;
height:900px;
width:800px;
margin:10px auto;
}
#header
{
background:#1F8DD7;
height:200px;
width:100%;
background:#1F8DD7;
height:200px;
width:100%;
}
#nav
{
background:#3e686d;
height:30px;
width:100%;
}
#navul li{
list-style-type:none;
display:inline;
}
#navul li a{
text-decoration:none;
color:white;
padding-left:10px;
padding-right:10px;
line-height:30px;
}
#navul li a:hover{
color:black;
}
#navul li a:hover,#lful li a:hover{
color:blue;
}
#container{
background:#934BFE;
height:650px;
width:100%;

}
#footer{
background:#1F8DD7;
height:30px;
width:100%;
color:white;
line-height:30px;
}
#userlogin
{
min-height:35px;
width:50px;
margin-left:150px;
margin-top:25px;
border:1px solid #ff8000;
border-radius:5px;
}
#userlogin legend{
margin-left:5px;
font-size:18px;
color:#80ff00;
}
#user_table
{
margin:50px;
font-size:18px;
}
#user_table tr td{
padding:10px;
}
#user_table a{

color:#black;
text-decoration:none;
}
#user_table a:hover{

color:yellow;
text-decoration:underline;
}
#user_table input[type="text"],#user_table input[type="password"]
{
width:250px;
height:20px;
border-radius:5px;
font-size:18px;
color:blue;
}
#user_table input[type="submit"],#user_table input[type="reset"],#user_table input[type="select"]
{
width:100px;
height:30px;
border-radius:5px;
font-size:15px;
color:white;
}
#sbtn{
background:#0080ff;
border:1px solid #0080ff;
}
#rbtn
{
background:#5e0000;
border:1px solid #5e0000;
}

Comments

Popular posts from this blog

Forgot password using codeigniter

Facebook Login With Codeigniter

Geofencing Add Marker and Fetch data from database