From Big Lemur, 6 Years ago, written in Plain Text.
">

A PHP Error was encountered

Severity: Notice

Message: Trying to access array offset on value of type bool

Filename: view/view.php

Line Number: 25

Backtrace:

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/themes/geocities/views/view/view.php
Line: 25
Function: _error_handler

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/core/MY_Loader.php
Line: 173
Function: include

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/core/MY_Loader.php
Line: 43
Function: _ci_load

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/controllers/Main.php
Line: 700
Function: view

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/index.php
Line: 315
Function: require_once

from

A PHP Error was encountered

Severity: Notice

Message: Trying to access array offset on value of type bool

Filename: view/view.php

Line Number: 25

Backtrace:

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/themes/geocities/views/view/view.php
Line: 25
Function: _error_handler

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/core/MY_Loader.php
Line: 173
Function: include

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/core/MY_Loader.php
Line: 43
Function: _ci_load

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/controllers/Main.php
Line: 700
Function: view

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/index.php
Line: 315
Function: require_once

- view diff
Embed
  1. <?php
  2.  
  3.         session_start();
  4.        
  5.         include("conn.php");
  6.        
  7.        
  8.         //$checkuser = "Select * FROM users WHERE username='$user' and password='$pw' ";
  9.        
  10.         //$result = $conn->query($checkuser);
  11.        
  12.         //if(!result) {
  13.         //      echo $conn->error;
  14.                 //}
  15.  
  16.        
  17.         //$num = $result->num_rows;
  18.        
  19.         //if($num>0){
  20.         //      $id=$_SESSION['40127651_id'];
  21.        
  22.                        
  23.         //      header('Location: account.php');
  24.         //} else {
  25.         //      header('location: login.php');
  26.         //}
  27.        
  28.  
  29. //if(isset($user)){
  30.  
  31. //$read = "SELECT * FROM user WHERE username = '$username'";
  32.  
  33. //$result = $conn->query($read);
  34. //}
  35. //if(!$result) {
  36. //echo $conn->error;
  37. //}
  38.  
  39.  
  40.  
  41. $user = $_POST['username'];
  42. $pass = $_POST['pw'];
  43.  
  44. $checkuser = "SELECT * FROM users WHERE username = '$user' AND password = '$pw' ";
  45.  
  46. $result = $conn -> query($checkuser);
  47.  
  48. if (!$result) {
  49.   echo $conn->error;
  50. }
  51.  
  52. $num = $result ->num_rows;
  53.  
  54. if ($num > 0) {
  55.         $id = -1;
  56.         while ($row = $result->fetch_assoc()){
  57.                 $id = $row['id'];
  58.         }
  59.   $_SESSION['40127651_user'] = $user;
  60.   $_SESSION['user_id'] = $id;
  61.  
  62.   header('Location: account.php');
  63. } else {
  64.   header('Location: account.php');
  65. }
  66.  
  67.  ?>