开发者

php mysql error on header url for missing DOT before extension

开发者 https://www.devze.com 2023-02-28 05:32 出处:网络
i need this url return to my main page.... mysite.com i use this for empty id or wurl to return to error page

i need this url return to my main page.... mysite.com i use this for empty id or wurl to return to error page

if($_GET["wurl"]!=""){
}else{
header("Location: /404NotFound.php");
exit();
}

what i do for this url to return to my main page or error page

http://www.mysite开发者_如何转开发.com/Toni-Michelle-Braxton-4618html

???


I'm taking a wild guess and assume the code snippet is your rewriterule handler. (That's what the last comment suggests). If so, then you might already succeed with:

if (!strstr($_GET["wurl"], ".html")){   //or just "." instead of ".html"
    exit(header("Location: /404NotFound.php"));
}

Try that before your existing if block. Should it not work, say so, and someone else can make a lucky code suggestion.

PS: It would be better if you just tested for the existence of the files. (I also surmise you do an unfiltered include there..)

0

精彩评论

暂无评论...
验证码 换一张
取 消