<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>DB Registration Page</title>
<script type="text/javascript">
function fun1()
{
confirm("are you sure :");
}
</script>
</head>
<ul>
<li> <i> <a href="add.php ">Add</a> </i> </li>
<li> <i> <a href="view.php"> View</a> </i> </li>
<li> <i> <a href="edit.php"> Edit</a> </i> </li>
</ul>
<body>
<table border="" cellpadding="2" align="center" bgcolor="#CCFFFF" style="text-align:left" >
<tr><td>
<p><strong> Registration form</strong></p></td></tr>
<form name="form1" method="post" action=" ">
<tr> <td> Username. </td> <td><input type="text" name="txtuser" placeholder="enter user name" /> </td></tr>
<tr> <td> Password. </td> <td><input type="password" name="txtpwd" placeholder="enter password" /> </td></tr>
<tr> <td> CPWord. </td> <td><input type="password" name="txtcpwd" placeholder="enter Cpassword" /> </td></tr>
<tr> <td> Address. </td> <td><textarea name="txtaddress" cols="22" rows="3" placeholder="ex:hno:--- (v.name)---(mdl)---(pin)5000001
etc.."></textarea></td> </tr>
<tr> <td>Email Id... </td> <td><input type="text" name="txtemailid" placeholder="ex:user@gmail.com" /></td> </tr>
<tr> <td>
Gender:
</td>
<td><label>
<input type="radio" name="gender" value="male" id="gender_0" checked=""/>male</label>
<label> <input type="radio" name="gender" value="female" id="gender_1" onfocus="gender" />female</label>
</td>
</tr>
<tr> <td> Languages Known :
</td>
<td> <label><input type="checkbox" name="lang" value="eng" id="languagesknown_0" /> English</label>
<label> <input type="checkbox" name="lang1" value="Hin" id="languagesknown_1" /> Hindi</label>
</td>
</tr>
<tr><td>Education Details:</td><td align="center">
<select name="dropdown" onchange="selectDropdown" >
<option>Degree</option>
<option>Intermediate</option>
<option>Tenth</option>
</select>
</td></tr>
<tr> <td align="left"> About You(1000)
</td>
<td> <textarea name="about" cols="22" rows="3" placeholder="brief discription"></textarea>
</td>
</tr>
<tr> <td></td>
<td align="center"> <input type="submit" value="submit" name="btnsubmit" onclick="fun1()"/>
</td>
</tr>
</form>
</table>
<br />
<?php
include("connect-db.php");
$username= $_POST["txtuser"];
$password1= $_POST["txtpwd"];
$address= $_POST['txtaddress'];
$emailid= $_POST['txtemailid'];
$gender= $_POST['gender'];
$language= $_POST['lang'].",".$_POST['lang1'];
$education=$_POST["dropdown"];
$about= $_POST['about'];
$user_name = "root";
$password = "";
$database = "raju";
$server = "127.0.0.1";
$db_handle = mysql_connect($server, $user_name, $password);
$db_found = mysql_select_db($database, $db_handle);
if($db_found)
{
$insertion=mysql_query("insert into registration(username,password,address,emaiid,gender,language,about,education)values('$username','$password1','$address','$emailid','$gender','$language','$about','$education')") or die(mysql_error());
}
echo "data inserted successfully";
?>
<a href=" view.php">view the details of the users</a>
<br />
<br/>
</body>
</html>
No comments:
Post a Comment