作者yorjing (托儿所婴儿)
看板PHP
标题Re: [问题]$_SERVER["PHP_SELF"]?
时间Mon Feb 12 22:49:44 2007
※ 引述《buganini (霸格尼尼)》之铭言:
: ※ 引述《yorjing (托儿所婴儿)》之铭言:
: : 请问一下各位大大
: : $_SERVER["PHP_SELF"]这要怎麽用?
: : 小弟今天无聊爬一下文
: : 发现了验证码
: : 抓来跑一跑
: : 图跟文字都有了
: : 可是要验证我输入的文字正不正确时
: : 他居然跑出"未授权您检视此网页"的讯息
: : 看了一下程式码
: : 好像问题出现在$_SERVER["PHP_SELF"]
: : 看一看上下文程式码
: : 再看了一下结果
: : 推敲出他是跑到自己的网页
: : 可是验证程式码时
: : 居然跳到"未授权您检视此网页"XD
: : 更奇怪的是
: : 在按验证纽後
: : 火狐跟ie网址列网址不一样
: : 火狐:http://localhost/files/%3C?=$_SERVER['PHP_SELF']?%3E
: : IE:http://localhost/files/<?=$_SERVER['PHP_SELF']?>
: : 程式在这
: : http://www.devshed.com/c/a/PHP/Security-Images-in-PHP/5/
: : 在两个执行结果图案的上面
: : 如果我推敲的没错的话
: : 按了"Sign up!"之後应该要执行
: : 最下面的表单的上面那一段php程式码
: : 可是他却没有执行
: : 而是跳到"未授权您检视此网页"
: : 可以请各位大大指导一下小弟一下吗
: : 小弟不知道怎麽改这个bug
: : 先在这里谢谢各位大大
: 你的PHP parser没有被呼叫到
: 确认你的php.ini里面
: short_open_tag = On
谢谢B大的帮忙
小弟已经不会跑到"未授权你检视网页"
可是
他没有跑下面这段
<?php
if (isset($HTTP_POST_VARS["name"]) && isset($HTTP_POST_VARS["security_try"]))
{
//Connect to database
mysql_connect("localhost", "username", "password");
mysql_select_db("dw_php");
//Set variables, and call checkSecurityImage
$security_refid = $HTTP_POST_VARS["security_refid"];
$security_try = $HTTP_POST_VARS["security_try"];
$checkSecurity = checkSecurityImage($security_refid, $security_try);
//Depending on result, tell user entered value was correct or incorrect
if ($checkSecurity) {
$validnot = "correct";
} else {
$validnot = "incorrect";
}
//Write output
echo("<b>You entered this as the security text:</b><br>\n
".$security_try."<br>\n
This is ".$validnot.".<br>\n
-------------------------------<br><br>\n
");
}
?>
所以我不知道他的验证结果是错误还是正确
请问各位大大
要怎样才能让他跑出验证结果
再次麻烦各位大大了
谢谢各位大大的帮忙
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 61.224.207.201
1F:→ yorjing:发现是设定问题 在网路空间主机上可以 请问哪边还要设定? 02/12 23:04
2F:→ yorjing:可以请各位大大指导一下吗? 02/12 23:05