Home > Backend Development > PHP Tutorial > php解决地址栏中参数不正确输入而跳转到的空白页面有关问题

php解决地址栏中参数不正确输入而跳转到的空白页面有关问题

WBOY
Release: 2016-06-13 10:50:40
Original
1106 people have browsed it

php解决地址栏中参数不正确输入而跳转到的空白页面问题
如题。比方说有这样的网址http://localhost:8080/test.php?id=12&tie=23
我在地址栏中把后面两个参数改了,成数值很大的比如说100000,则出现的结果是页面中没有数据输出,或者把参数改成字母或者汉字,则都没有数据输出,,怎么设置可以让这种错误的链接跳转到我指定的错误界面,而不再显示空白的页面!

------解决方案--------------------

PHP code
if($_GET['某一个参数'] == ‘不合法’){    die('<script>localtion.href="指定错误界面的url"</script>');}<br><font color="#e78608">------解决方案--------------------</font><br><br>header('Location: http://www.baidu.com/');<br>exit;<div class="clear">
                 
              
              
        
            </div>
Copy after login
Related labels:
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