Why the value entered by $p is the same as the value of $w but the if judgment is still different?
Let’s look at the code——
<?php
$p =$_GET['pw'];
$a=file('data.php');
$w=$a[9];//Get the file number of data.php 10 lines of content
if($p == $w){
echo "Welcome back";
}else{
$url = " 403.html";
echo "<script language='javascript' type='text/javascript'>";
echo "window.location.href='$url' ";
echo "</script>";
}
?>
The following data.php——
<?php
//Prohibit accessing this file through url
$url = "403.html";
echo "<script language='javascript' type='text/javascript'>";
echo "window.location.href='$url'";
echo "</script>";
//Accessing this file will jump to the forbidden page
die("This page is forbidden");//Just in case
?>
6117
天蓬老师2020-12-21 14:05:39
The editor has a code block function, but plain text without highlighting looks inconvenient