Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <title>ECA Consultant New User</title>
- <meta charset="utf-8">
- <link rel="stylesheet" href="CSS/Common.css" type="text/css">
- <script src="Script/myscript.js"></script>
- </head>
- <body onload ="pload()">
- <img src="img/bunny.jpg" alt="logo">
- <p id="date1">Date</p>
- <p id="time1">Time</p>
- <h3>Navigation</h3>
- <nav>
- <ul>
- <li><a href="home.html">Home</a></li>
- <li><a href="login.html">Login</a></li>
- <li><a href="addedit.php">New User</a></li>
- <li><a href="aboutus.html">About Us</a></li>
- <li><a href="contactus.html">Contact Us</a></li>
- </ul>
- </nav>
- <h1>Welcome to the Soon Gold</h1>
- <h2>Please Log in to the check your details</h2>
- <?php
- //Declare all the variable fordb connection
- $dbserver="localhost:3307";
- $dbuser="root";
- $dbpassword="";
- $dbname="kmcustomer";
- //create connection error
- $conn= new mysqli($dbserver,$dbuser,$dbpassword,$dbname);
- //check the connection successful
- if($conn->connect_error==true){
- die("Connection failed error description: $conn->connect_error");
- }else{
- echo"<p class='dbs'>Connection successful</p>";
- }
- $name=$_POST['name'];
- $city=$_POST['city'];
- $dob=date('Y-m-d',strtotime($_POST['dob']));
- $contactno=$_POST['contactno'];
- $password=$_POST['password'];
- //create sql statement
- $sql="INSERT INTO CUSTOMER(NAME,CITY,DOB,PHONE,PASSWORD)
- VALUES('$name','$city','$dob','$contactno','$password')";
- //execute sql and assign to result
- $result = $conn->query($sql);
- //check whether result has any rows
- if($result==true){
- //display welcome
- echo"<h1>Welcome to Soon Gold $name your details has been added</h1>";
- } else{
- echo"<p class='fail'>Your details are not accepted please try again $conn->error</p>";
- }
- ?>
- <footer>
- <p>Copyright © 2019 - All right Reserved</p>
- <p>Kiran G M</p>
- </footer>
- </body>
- </html>
Add Comment
Please, Sign In to add comment