daily pastebin goal
30%
SHARE
TWEET

login_update.php

a guest Jun 18th, 2017 134 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. include "db.php";
  3. include "functions.php";
  4.  
  5. /* show errors in console */
  6.   ini_set('display_errors', 1);
  7.   ini_set('display_startup_errors', 1);
  8.   error_reporting(E_ALL);
  9.  
  10.   // connection needs to be global
  11.         global $connection;
  12.         $query = "SELECT * FROM tl_users";
  13.         // Performs a query on the database (connection, query)
  14.         $result = mysqli_query($connection, $query);
  15.  
  16.  
  17.    
  18.   // error: , instead of &&
  19.   if(isset($_POST['username'], $_POST['password']) ){
  20.     $username = $_POST['username'];
  21.     $password = $_POST['password'];
  22.   }
  23.  
  24. ?>
  25.  
  26. <!DOCTYPE html>
  27. <html lang="en">
  28. <head>
  29.     <meta charset="UTF-8">
  30.     <title>Document</title>
  31.     <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">
  32. </head>
  33. <body>
  34. <div class="container">
  35.    
  36.     <div class="col-sm-6">
  37.  
  38.         <form action="login_update.php" method="post">
  39.             <div class="form-group">
  40.             <label for="username">Username</label>
  41.             <!-- display current username -->
  42.             <input type="text" name="username" class="form-control" value="<?php echo $username;?>">
  43.             </div>
  44.            
  45.             <!-- display current password (change password to text) -->
  46.             <div class="form-group">
  47.             <label for="password">Password</label>
  48.             <input type="text" name="password" class="form-control" value="<?php echo $password;?>">
  49.             </div>
  50.  
  51.             <!-- id field -->
  52.             <div class="form-group">
  53.             <select name="" id="">
  54.                 <?php
  55.                     showAllData();
  56.                 ?>
  57.             </select>
  58.             </div>
  59.            
  60.             <input class="btn btn-primary" type="submit" name="submit" value="Update">
  61.            
  62.         </form>
  63.        
  64.  
  65.     </div>
  66. </div>
  67. </body>
  68. </html>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top