Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.63 KB | None | 0 0
  1.  
  2. // new method in the mother class  
  3. static function fetch_me() {
  4.     $conn = new mysqli("host", "root",  "1657", "db");
  5.     if ($x = $conn->query("SELECT user_info.profile_pic, user_info.bio, users.email, users.password FROM user_info INNER JOIN users ON user_info.username=users.username WHERE user_info.username='". $_SESSION['username']. "'")) {
  6.         return $row = $x->fetch_assoc();
  7.     }
  8.     }
  9.  
  10. // then on the settings page
  11.  
  12. $init = new Member();
  13. $myself = $init::fetch_me();
  14.  
  15. @$pass = $_POST['pass'];
  16. @$email = $_POST['email'];
  17.  
  18.  
  19. if (!empty($pass) && !empty($email)) {
  20.     $init->change_email($myself['password'], $myself['email']);
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement