Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $server="localhost";
- $user="root";
- $password="";
- $db="bank";
- $con=mysqli_connect($server,$user,$password,$db);
- if(!$con)
- die("Not connected".mysqli_error());
- else
- echo "connection done";
- if(isset($_POST['submit']))
- {
- $c_name=$_POST['name'];
- $c_city=$_POST['city'];
- $c_street=$_POST['street'];
- $query= "INSERT INTO customer(customer_name,customer_city,customer_street) VALUES ('$c_name','$c_city','$c_street')";
- $result=mysqli_query($con,$query);
- if($result)
- echo "\nRecord added successfully <br>";
- }
- mysqli_close($con);
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <title> Bank Database </title>
- </head>
- <body>
- <h2>IST Bank</h2>
- <form action="form.php" method="post">
- Name:<br>
- <input type="text" name="name">
- <br>
- City:<br>
- <input type="text" name="city">
- <br>
- Street:<br>
- <input type="text" name="street">
- <br>
- <input type="submit" name="submit" value="submit">
- </form>
- </body>
- </html>
Add Comment
Please, Sign In to add comment