You are here: Re: Faked $_SERVER variables « PHP Programming Language « IT news, forums, messages
Re: Faked $_SERVER variables

Posted by Ivαn Sαnchez Ortega on 06/01/07 14:48

e_matthes@hotmail.com wrote:

> I keep reading that $_SERVER['HTTP_REFERER'] can easily be faked. Is
> that true of all server variables, or just some of them? In
> particular, I'm wondering if server_port can be faked.

Unless your HTTP server runs in more than one port, that's pretty difficult.

> I'm interested right now because I want to detect whether the current
> page request is using http or https.

Don't. Set up your web server to serve different pages over HTTP and over
HTTPS.

> I realize there are other ways to ensure the correct delivery of pages
> over https using directory management and htaccess, but I also want to
> understand the server variables better.

Server variables are pretty simple: Whenever the web server receives a
request for a PHP page, it spawns (or dispatches) a thread running the PHP
interpreter. That thread will receive the complete URL, any posted data,
and a handful of information. That "handful of information" is the $_SERVER
variables.

--
----------------------------------
IvΓ‘n SΓ‘nchez Ortega -ivansanchez-algarroba-escomposlinux-punto-org-

http://acm.asoc.fi.upm.es/~mr/ ; http://acm.asoc.fi.upm.es/~ivan/
MSN:i_eat_s_p_a_m_for_breakfast@hotmail.com
Jabber:ivansanchez@jabber.org ; ivansanchez@kdetalk.net

 

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

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