0 comments

Registration form in php

Published on Friday, April 16, 2010 in


<html>

<head>


<title>test</title>

</head>

<body>

<form action="<?php $_SERVER['PHP_SELF']; ?>" method="post" >

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

<tr>

<td>name</td>

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

</tr>

<tr>

<td>address</td>

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

</tr>

<tr>

<td>pi</td>

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

</tr>

<tr>

<td>&nbsp;</td>

<td> <input type="submit" name="11"/> </td>

</tr>

</table>

</form>


<?php


if (isset($_POST['11']))

{


mysql_connect("localhost","root","");

mysql_select_db("test1");

$query="INSERT INTO `tablename` (`field1`, `field2`, `field3`) VALUES ('".$_POST['user']."', '".$_POST['address']."', '".$_POST['pin']."')";

mysql_query($query);

echo "Data inserted";

}

else

{


}

?>

</body>

</html>

Spread The Love, Share Our Article

Related Posts

No Response to "Registration form in php"