Registration form in php

Frist page reg.php(Registration page)


<form action="insert1.php" method="post" target="LoadData">

<table width="400" border="1">

<tr>

<td>Name</td>

<td> <input type="text" name="name" /></td>

</tr>

<tr>

<td>Password</td>

<td> <input type="password" name="name1" /> </td>

</tr>



<tr>

<td>Email</td>

<td ><label>

<textarea name="text"></textarea>

</label></td>

</tr>

<tr>

<td>&nbsp;</td>

<td > <input name="Rest" type="reset" id="Rest" value="Reset" /> <input type="submit" /> </td>

</tr>

</table></form>


Second form insert1.php(insert function page)


<?php

$name=$_REQUEST['name'];

$anu=$_REQUEST['name1'];


$text=$_REQUEST['text'];

mysql_connect("localhost","root",""); //Connecton String (database,usename,password)

mysql_select_db("test1");

$query="INSERT INTO tablename ( `field_name`, `field_pass`, `field_address`) VALUES ( '$name','$anu', '$text')";

echo $query;

mysql_query($query);

echo "value insert into database";

?>

No comments: