You are here: Re: If isset query_string return 404 « PHP Programming Language « IT news, forums, messages
Re: If isset query_string return 404

Posted by d on 09/26/28 11:37

"Kimmo Laine" <spam@outolempi.net> wrote in message
news:Dl5zf.3546$sO4.1414@reader1.news.jippii.net...
> "wd" <n23@nospam.invalid> wrote in message
> news:pan.2006.01.17.11.23.23.321125@nospam.invalid...
>>I want my server to send a 404 header if a URL with a query string is
>> requested. So if a browser or spider requests something
>> like
>> www. my_site .com?p=chair
>> they would get a 404...
>>
>> But if they request
>> www. my_site .com/chair.htm
>> everything would be normal.
>>
>> With some assistance this is what I have so far, but it isn't working
>> correctly. It always displays the 404, even when there is no question
>> mark in the URL. Also, I would like the page to stop displaying anything
>> after the "HTML>>>" if it sends the 404 error, but I'm not sure how to do
>> it:
>>
>>
>> if (isset($_SERVER["QUERY_STRING"])) {
>
>
> Try something like if(sizeof($_GET)){...

Just do this:

if ($_SERVER["QUERY_STRING"]=="") {
// OK
} else {
// Query string present
}

> --
> "En ole paha ihminen, mutta omenat ovat elinkeinoni." -Perttu Sirviφ
> spam@outolempi.net | Gedoon-S @ IRCnet | rot13(xvzzb@bhgbyrzcv.arg)

 

Navigation:

[Reply to this message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация