Created
January 26, 2017 16:39
-
-
Save ptmaroct/aa675df439db704e03e7c43d6adb5ee8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <form action="test.php" method="POST"> | |
| Name:<input type="text" name="name"><br/> | |
| Email Id:<input type="email" name="email"> <br/> | |
| Phone Number:<input type="number" name="phone"> <br/> | |
| <input type="submit" value="Submit"> | |
| </form> | |
| <?php | |
| $host='localhost'; | |
| $user='root'; | |
| $pass=''; | |
| $db='amrit'; | |
| $name=$_POST['name']; | |
| $email=$_POST['email']; | |
| $phone=$_POST['phone']; | |
| echo "$name $email $phone"; | |
| $conn = mysqli_connect($host,$user,$pass,$db); | |
| $query = "insert into data(Name,Email,Phone) values('$name','$email','$phone')"; | |
| $result= mysqli_query($conn,$query); | |
| if($result===TRUE){ | |
| echo "Data Inserted"; | |
| } | |
| else{ | |
| echo "Error"; | |
| } | |
| mysqli_close($conn); | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment