When authorizing a white screen, how to identify the cause of this? In the table is only 1 password. enter image description here

<?php include 'bd.php'; $result = mysql_query("SELECT adminpass FROM adminpassword"); $array = mysql_fetch_array($result); if(!empty($_POST['password'])){ if($_POST['password']==$array[adminpass]){ session_start(); $_SESSION['access']=true; header("Location: adminpanel"); } else { header("Location: error"); } } else { ?> CONTENT... <?php } ?> 
  • Comments are not intended for extended discussion; conversation moved to chat . - Yuriy SPb

2 answers 2

To see PHP errors you can after include 'bd.php'; put the following code

 ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); 

But maybe you have a problem in the mysql request. Therefore, after calling mysql_query this code to see a mysql error.

 if(!$result) { print_r(mysql_error(); exit; } 
  • if you read the comments, you would see that there are no problems with the request. - teran

Use pdo , there is an error output, there are examples, and yes you have not shielded the request, that is, there is no protection against injections, usually errors are displayed like this:

 try { .... } catch (Exception $e) { .... } 
  • There are no parameters in this request to screen and inject anything - teran