php跳转语句不同写法的安全性问题

WBOY
Release: 2016-06-23 14:38:06
Original
1108 people have browsed it

这样写

 echo "Location.href='../login.php';";
Copy after login
Copy after login
Copy after login
Copy after login

和这样写
 echo "Location.href=/"../login.php/";";
Copy after login
Copy after login
Copy after login
Copy after login

在安全性问题上有什么区别么。


回复讨论(解决方案)

第二句能正常输出么?

呃,两句的引号都有问题

这样写

 echo "Location.href='../login.php';";
Copy after login
Copy after login
Copy after login
Copy after login

和这样写
 echo "Location.href=/"../login.php/";";
Copy after login
Copy after login
Copy after login
Copy after login

在安全性问题上有什么区别么。

抱歉 是这样的
1. echo "location.href='../login.php';";
2. echo "location.href=/"../login.php/";";

问题补充

前后有
echo "<script>"; <br /> <br /> echo "</script>";


这样写

 echo "Location.href='../login.php';";
Copy after login
Copy after login
Copy after login
Copy after login

和这样写
 echo "Location.href=/"../login.php/";";
Copy after login
Copy after login
Copy after login
Copy after login

在安全性问题上有什么区别么。

抱歉 是这样的
1. echo "location.href='../login.php';";
2. echo "location.href=/"../login.php/";";


这个第二句还是有问题的,是不是问的是反斜杠啊?

1、都写到页面里了,没有安全性可言
2、
href='../login.php'
是相对当前路径的上级
href="/../login.php/";
是网站的上级目录,已经越出范围了!



这样写

 echo "Location.href='../login.php';";
Copy after login
Copy after login
Copy after login
Copy after login

和这样写
 echo "Location.href=/"../login.php/";";
Copy after login
Copy after login
Copy after login
Copy after login

在安全性问题上有什么区别么。

抱歉   是这样的
1. echo "location.href='../login.php';";
2. echo "location.href=/"../login.php/";";


这个第二句还是有问题的,是不是问的是反斜杠啊?
就是反斜杠,不好意思哈,没表达清楚

1. echo "location.href='../login.php';";
输出的是 location.href='../login.php';
2. echo "location.href=\"../login.php\";";
输出的是 location.href="../login.php";

你说他们有什么差别?
js 的字符串可以用单引号括起,也可以用双引号括起

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template