Guest User

bunny

a guest
Feb 10th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.38 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <title>ECA Consultant New User</title>
  5. <meta charset="utf-8">
  6. <link rel="stylesheet" href="CSS/Common.css" type="text/css">
  7. <script src="Script/myscript.js"></script>
  8. </head>
  9. <body onload ="pload()">
  10.  
  11. <img src="img/bunny.jpg" alt="logo">
  12. <p id="date1">Date</p>
  13. <p id="time1">Time</p>
  14. <h3>Navigation</h3>
  15. <nav>
  16. <ul>
  17. <li><a href="home.html">Home</a></li>
  18. <li><a href="login.html">Login</a></li>
  19. <li><a href="addedit.php">New User</a></li>
  20. <li><a href="aboutus.html">About Us</a></li>
  21. <li><a href="contactus.html">Contact Us</a></li>
  22. </ul>
  23. </nav>
  24. <h1>Welcome to the Soon Gold</h1>
  25. <h2>Please Log in to the check your details</h2>
  26. <?php
  27. //Declare all the variable fordb connection
  28. $dbserver="localhost:3307";
  29. $dbuser="root";
  30. $dbpassword="";
  31. $dbname="kmcustomer";
  32. //create connection error
  33. $conn= new mysqli($dbserver,$dbuser,$dbpassword,$dbname);
  34. //check the connection successful
  35. if($conn->connect_error==true){
  36. die("Connection failed error description: $conn->connect_error");
  37. }else{
  38. echo"<p class='dbs'>Connection successful</p>";
  39. }
  40. $name=$_POST['name'];
  41. $city=$_POST['city'];
  42. $dob=date('Y-m-d',strtotime($_POST['dob']));
  43. $contactno=$_POST['contactno'];
  44. $password=$_POST['password'];
  45.  
  46. //create sql statement
  47. $sql="INSERT INTO CUSTOMER(NAME,CITY,DOB,PHONE,PASSWORD)
  48. VALUES('$name','$city','$dob','$contactno','$password')";
  49. //execute sql and assign to result
  50. $result = $conn->query($sql);
  51. //check whether result has any rows
  52. if($result==true){
  53. //display welcome
  54. echo"<h1>Welcome to Soon Gold $name your details has been added</h1>";
  55.  
  56. } else{
  57. echo"<p class='fail'>Your details are not accepted please try again $conn->error</p>";
  58. }
  59. ?>
  60.  
  61. <footer>
  62. <p>Copyright &copy; 2019 - All right Reserved</p>
  63. <p>Kiran G M</p>
  64. </footer>
  65.  
  66. </body>
  67. </html>
Add Comment
Please, Sign In to add comment