0

我使用这个网址:

http://domain.co.uk/iphone/index.php?c=knnKVLO4ROKPvvtxUCDu&bhsirf=Q8IP6OKRtaOCjcCgpb94&9froifhew3=ux9XI0vjKfzieTVS6rTt&40289njgw=We80L1RXDPIQj4ENL3QM&AdjoirtGERG^%%C2%A3fd=ozS60iysc1Vd9QgVDZIP&jorw4958fq%C2%A3$=2kbCk7EXRNMZlYMhDdkhVm2E3j4sNDtmo8ho2Ag6&ffjg^GDDFGn2FFGHe=8fuTCaTzKbf1VYQPcornK8LOK4ERPT43XoegnvTByli9c1rIInTwvwvShxkN&a@@^%45383fhreFGGew=48bFy4U6bBYcMqLHnVfK2kbCk7EXRNMZlYMhDdkh&fGHDFb.fewfrgopewFRWGREG=gbBYKubAEk7DcpQ69M7ZkxVGa2aSWiYlrEXOUqDINYsKnnMhf0hHqhQGdMUS9M3Zy74em2NIrubulwS5XcPmgHytg8we8f1y9aR2&gfiegrowu895743fdGTRY%C2%A3QT%C2%A3%yewhfuigw9545TRWTRYEgsgfnfht34o=vXBuTfXODHxQsHJZH9MQx4TrFZ38eaEmm5eowcKVgeH69YYGWofJQI0Y4jE9GDhFrHdFhMc2Tqtlb4LwWEO47z5IrEp42QppEYMlLzx4yIFlxpNZ3g4gU384DqYPNo9c3Ks2RGGNEVaMhJNewC6g48WHeEhP6r5tfOpI5OyCsNiukHXfoAqVxtaggqt6xkce74hP4f22

然后在我的PHP中:

<?php
if($_GET["c"] == 'knnKVLO4ROKPvvtxUCDu' and $_GET["bhsirf"] == 'Q8IP6OKRtaOCjcCgpb94' and $_GET["9froifhew3"] == 'ux9XI0vjKfzieTVS6rTt' and $_GET["40289njgw"] == 'We80L1RXDPIQj4ENL3QM' and $_GET["AdjoirtGERG^%£fd"] == 'ozS60iysc1Vd9QgVDZIP' and $_GET["jorw4958fq£$"] == '2kbCk7EXRNMZlYMhDdkhVm2E3j4sNDtmo8ho2Ag6' and $_GET["ffjg^GDDFGn2FFGHe"] == '8fuTCaTzKbf1VYQPcornK8LOK4ERPT43XoegnvTByli9c1rIInTwvwvShxkN' and $_GET["a@@^%45383fhreFGGew"] == '48bFy4U6bBYcMqLHnVfK2kbCk7EXRNMZlYMhDdkh' and $_GET["fGHDFb.fewfrgopewFRWGREG"] == 'gbBYKubAEk7DcpQ69M7ZkxVGa2aSWiYlrEXOUqDINYsKnnMhf0hHqhQGdMUS9M3Zy74em2NIrubulwS5XcPmgHytg8we8f1y9aR2' and $_GET["gfiegrowu895743fdGTRY£QT£%yewhfuigw9545TRWTRYEgsgfnfht34o"] == 'vXBuTfXODHxQsHJZH9MQx4TrFZ38eaEmm5eowcKVgeH69YYGWofJQI0Y4jE9GDhFrHdFhMc2Tqtlb4LwWEO47z5IrEp42QppEYMlLzx4yIFlxpNZ3g4gU384DqYPNo9c3Ks2RGGNEVaMhJNewC6g48WHeEhP6r5tfOpI5OyCsNiukHXfoAqVxtaggqt6xkce74hP4f22')
{
    //fine
}
else
{
    header("Location: /iphone/error.php");
}
?>

但即使一切正确,它也会重定向到 error.php 页面。我的琴弦太长还是有其他问题?

这是 $_GET 的 var_dump:

errorarray(10) { ["index_php?c"]=> string(20) "knnKVLO4ROKPvvtxUCDu" ["bhsirf"]=> string(20) "Q8IP6OKRtaOCjcCgpb94" ["9froifhew3"]=> string(20) "ux9XI0vjKfzieTVS6rTt" ["40289njgw"]=> string(20) "We80L1RXDPIQj4ENL3QM" ["AdjoirtGERG^%£fd"]=> string(20) "ozS60iysc1Vd9QgVDZIP" ["jorw4958fq£$"]=> string(40) "2kbCk7EXRNMZlYMhDdkhVm2E3j4sNDtmo8ho2Ag6" ["ffjg^GDDFGn2FFGHe"]=> string(60) "8fuTCaTzKbf1VYQPcornK8LOK4ERPT43XoegnvTByli9c1rIInTwvwvShxkN" ["a@@^E383fhreFGGew"]=> string(40) "48bFy4U6bBYcMqLHnVfK2kbCk7EXRNMZlYMhDdkh" ["fGHDFb_fewfrgopewFRWGREG"]=> string(100) "gbBYKubAEk7DcpQ69M7ZkxVGa2aSWiYlrEXOUqDINYsKnnMhf0hHqhQGdMUS9M3Zy74em2NIrubulwS5XcPmgHytg8we8f1y9aR2" ["gfiegrowu895743fdGTRY£QT£%yewhfuigw9545TRWTRYEgsgfnfht34o"]=> string(200) "vXBuTfXODHxQsHJZH9MQx4TrFZ38eaEmm5eowcKVgeH69YYGWofJQI0Y4jE9GDhFrHdFhMc2Tqtlb4LwWEO47z5IrEp42QppEYMlLzx4yIFlxpNZ3g4gU384DqYPNo9c3Ks2RGGNEVaMhJNewC6g48WHeEhP6r5tfOpI5OyCsNiukHXfoAqVxtaggqt6xkce74hP4f22" }
4

4 回答 4

1

变量名中的点和空格被转换为下划线。例如<input name="a.b" /> becomes $_GET["a_b"] 参考这里

于 2013-05-19T14:08:08.793 回答
1

发现一个错误:

您使用数组中不存在的以下键:

$_GET["fGHDFb.fewfrgopewFRWGREG"]

这个虽然存在:

$_GET["fGHDFb_fewfrgopewFRWGREG"]

(有关解释,请参见埃米尔的回答)。

此外,$_GET["c"] 不是有效的密钥。不知何故,可能是因为重写规则(正如 Michael Berkowski 在对您的问题的评论中所建议的那样),它被更改为 $_GET["index_php?c"]。

话虽如此,您的解决方案似乎并不是最优的,因为您可能会遇到此类问题……您到底想完成什么?

于 2013-05-19T13:55:38.847 回答
0

问题可能与运算符优先级and和 && 不相等有关。

我会尝试and&&.

于 2013-05-19T13:46:57.140 回答
0

您发布的第一个和第二个代码对我来说似乎没问题,但由于某种原因,您被重定向到错误页面。用户“Frederik Wordenskjold”说明了您可能希望查看是否正常的不同键。我的建议是解决这个问题,或者至少知道它在哪里的线索是打印你在该文件中收到的每个 $_GET (评论“if-else”语句只是为了测试这个),这样你就可以意识到问题是否存在在您正在查找的文件中或通过 $_GET 收到的文件中

于 2013-05-19T14:31:39.273 回答