Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- require 'db.php'; //here is all the database connection settings //
- ?>
- <?php
- if ($_SERVER['REQUEST_METHOD'] == 'POST') {
- if (isset($_POST['addinfo'])) { //user logging in
- require 'addinfo.php';
- }
- }
- ?>
- <!DOCTYPE html>
- <head>
- </head>
- <body>
- <div class="container2">
- <form class="modal-content animate" method="post"
- action="account.php" style="z-index:10">
- <input type="text" placeholder='Country' name='country'id="q2"/>
- <input type="text" placeholder='City' name='city'id="q3"/>
- <input type="text" placeholder='Address' name='address'id="q4"/>
- <input type="text" placeholder='PostalCode'
- name='postalcode'id="q5"/>
- <button type="submit" id="sbmt" name='addinfo'>Submit</button>
- <a href="#" style="text-decoration:none; float:right; margin-
- right:34px;">change password</a>
- </form>
- </div>
- </body>
- <?php
- require 'db.php';$_SESSION['country'] = $_POST['country'];
- $_SESSION['city'] = $_POST['city'];
- $_SESSION['address'] = $_POST['address'];
- $_SESSION['postalcode'] = $_POST['postalcode'];
- $country = $_POST['country'];
- $city = $_POST['city'];
- $postalcode = $_POST['postalcode'];
- $address = $_POST['address'];
- $sql = "INSERT INTO users (country, city, postalcode, address) "
- . "VALUES ('$country','$city','$postalcode','$address')";
- ?>
- <?php
- $servidor = "localhost";
- $usuario= "root";
- $password = "";
- $base_datos = "accounts";
- $host = 'localhost';
- $user = 'root';
- $pass = '';
- $db = 'users';
- $mysqli = new mysqli($host,$user,$pass,$db) or die($mysqli->error);
- $conexion = new mysqli($servidor, $usuario, $password, $base_datos);
- $conexion1 = new mysqli($servidor, $usuario, $password, $base_datos);
- ?>
Add Comment
Please, Sign In to add comment