Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once("connection.php");
- if(isset($_GET['submit']))
- {
- $id=$_GET['id'];
- $f_name=$_GET['f_name'];
- $email=$_GET['email'];
- $contact=$_GET['contact'];
- $sql="insert into form values ('$id', '$f_name', '$email', '$contact')";
- mysqli_query($conn,$sql);
- }
- ?>
- <html>
- <body>
- <form action="index.php" method="get">
- </br>
- <label> id</label>
- <input type="number" name="id">
- </br>
- <label> First Name</label>
- <input type="text" name="f_name">
- </br>
- <label> Email</label>
- </br>
- <input type="email" name="email">
- </br><label>contact</label>
- </br>
- <input type="number" name="contact">
- </br>
- <input type="submit" name="submit">
- </form>
- </body>
- </html>
- <?php
- /**
- * Created by PhpStorm.
- * User: admin
- * Date: 11/8/2018
- * Time: 1:13 PM
- */
- $servername="localhost";
- $username="root";
- $password="";
- $db="form";
- $conn=new mysqli($servername,$username,$password,$db);
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- echo "Connected successfully";
- ?>
Add Comment
Please, Sign In to add comment