A question from a php newbie
手机用户1608450838
手机用户1608450838 2020-12-20 15:59:18
0
1
962

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

手机用户1608450838
手机用户1608450838

reply all(1)
天蓬老师

The editor has a code block function, but plain text without highlighting looks inconvenient

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template