Introduction
In this article I will describe how to design a simple sign up form for PHP. So in this article I will create two different applications, one for HTML design to provide the user view for sign up and the second one, that interacts with a MySQL database to save those values filled in by the new user. Now first I show you the simple design "sign up" form image. 
In order to create a user account, we need to gather a minimal amount of information from the user, we need his name, his password, maybe email id (if desired). So in the given image I use a name (textbox) password (textbox), gender( Radio button) and keep signed up (check box) fields.
The following is the registration form design code:
<html>
<body>
<form action="login.php" method="post">
<fieldset>
<legend><h1>Sign Up Form</h1></legend>
<div style="background:#00FF33;>
<label for="name"><b>Name</b></label><br />
<input name="name" id="name" style="background-color:White; color:#0033CC; type="text" /><br />
<label for="password"><b>Password</b></label><br />
<input name="password" id="password"
type="password" /><br /><br />
<label>
<input type="radio" name="gender" value="male"/>
Male
</label><br />
<label>
<input type="radio" name="gender" value="female"/>
Female
</label><br /><br />
<input type="submit" value="Submit" /><br />
<label>
<input type="checkbox" name="notify">Keep me signed in on this computer</label><br />
</div>
</fieldset>
</form>
</body>
</html>
So we have a text field for name, password, radio button for gender and a checkbox for keeping signed in. When you have filled in all values of the sign up form, it simply interacts with "login.php" using <form action="login.php" method="post">.The login.php is basically created to interact with the MySQL database to save those values that are filled in by the user.


AMRUTA PATILPosted Sep 14, 2013, 6:31 AM
<?PHP session_start(); include("config.PHP"); if($_REQUEST["btn_login"]=="submit") { $uname=$_POST["txt_login"]; $password=$_POST["txt_pwd"]; $sql="select * from user where user='".$uname."' and password='".$password."'"; //echo $sql; //exit; $res=mysql_query($sql); if($rs=mysql_num_rows($res)>0) { $_SESSION["uname"]=$uname; //echo $_SESSION["uname"]; //exit; //echo $rs; //exit; echo ""; } else { echo ""; } } ?> LOGIN FORM <?PHP if($_REQUEST["qs"]=="invalid") { echo "Invalid Username or Password"; } ?> Username: Password:
AMRUTA PATILPosted Sep 14, 2013, 6:30 AM
actually i have code of registration page and login page in php, both are very well executed and showing output. But i want keep button for signup/Registraion page on Login page. i am usung following code for Login page and registration page