Guest User

Untitled

a guest
Jan 21st, 2019
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 KB | None | 0 0
  1. <?php
  2. session_start();
  3. require 'db.php'; //here is all the database connection settings //
  4. ?>
  5. <?php
  6. if ($_SERVER['REQUEST_METHOD'] == 'POST') {
  7. if (isset($_POST['addinfo'])) { //user logging in
  8. require 'addinfo.php';
  9. }
  10. }
  11. ?>
  12. <!DOCTYPE html>
  13. <head>
  14. </head>
  15. <body>
  16. <div class="container2">
  17. <form class="modal-content animate" method="post"
  18. action="account.php" style="z-index:10">
  19. <input type="text" placeholder='Country' name='country'id="q2"/>
  20. <input type="text" placeholder='City' name='city'id="q3"/>
  21. <input type="text" placeholder='Address' name='address'id="q4"/>
  22. <input type="text" placeholder='PostalCode'
  23. name='postalcode'id="q5"/>
  24. <button type="submit" id="sbmt" name='addinfo'>Submit</button>
  25. <a href="#" style="text-decoration:none; float:right; margin-
  26. right:34px;">change password</a>
  27. </form>
  28. </div>
  29. </body>
  30.  
  31. <?php
  32. require 'db.php';$_SESSION['country'] = $_POST['country'];
  33. $_SESSION['city'] = $_POST['city'];
  34. $_SESSION['address'] = $_POST['address'];
  35. $_SESSION['postalcode'] = $_POST['postalcode'];
  36.  
  37. $country = $_POST['country'];
  38. $city = $_POST['city'];
  39. $postalcode = $_POST['postalcode'];
  40. $address = $_POST['address'];
  41.  
  42.  
  43. $sql = "INSERT INTO users (country, city, postalcode, address) "
  44. . "VALUES ('$country','$city','$postalcode','$address')";
  45.  
  46. ?>
  47.  
  48. <?php
  49. $servidor = "localhost";
  50. $usuario= "root";
  51. $password = "";
  52. $base_datos = "accounts";
  53.  
  54. $host = 'localhost';
  55. $user = 'root';
  56. $pass = '';
  57. $db = 'users';
  58. $mysqli = new mysqli($host,$user,$pass,$db) or die($mysqli->error);
  59.  
  60.  
  61.  
  62.  
  63. $conexion = new mysqli($servidor, $usuario, $password, $base_datos);
  64. $conexion1 = new mysqli($servidor, $usuario, $password, $base_datos);
  65.  
  66.  
  67. ?>
Add Comment
Please, Sign In to add comment