How to used basic Insert query in input field
<head>
<?php
// database connection
mysql_connect("localhost","root","");
//database sel
mysql_select_db("php");
if(isset($_POST["n1"])){
$name = $_POST["n"];
$address = $_POST["n3"];
$email = $_POST["n2"];
$password = $_POST["n5"];
$q = "insert into advanc_ephp (name, address, email, password) value ('$name', '$address', '$email', '$password')";
mysql_query($q);
echo'<h3 align="center">registration sussessfully</h3>';
}
?>
</head>
<body>
<form action="" method="post" ><pre>
name<input type="text" name="n" />
address<input type="text" name="n3" />
email<input type="email" name="n2" />
password<input type="password" name="n5" />
<input type="submit" name="n1" value="submit" />
</pre>
</form>
</body>
<head>
<?php
// database connection
mysql_connect("localhost","root","");
//database sel
mysql_select_db("php");
if(isset($_POST["n1"])){
$name = $_POST["n"];
$address = $_POST["n3"];
$email = $_POST["n2"];
$password = $_POST["n5"];
$q = "insert into advanc_ephp (name, address, email, password) value ('$name', '$address', '$email', '$password')";
mysql_query($q);
echo'<h3 align="center">registration sussessfully</h3>';
}
?>
</head>
<body>
<form action="" method="post" ><pre>
name<input type="text" name="n" />
address<input type="text" name="n3" />
email<input type="email" name="n2" />
password<input type="password" name="n5" />
<input type="submit" name="n1" value="submit" />
</pre>
</form>
</body>
No comments:
Post a Comment