You are here: Re: HTML to generate "this" URL « HTML « IT news, forums, messages
Re: HTML to generate "this" URL

Posted by Kim Andrι Akerψ on 11/17/05 17:20

David Blickstein wrote:

> Is there a way in HTML to generate the URL of "this" page. I have a
> page which moves around a lot and happens to be co-located with stuff
> that people need to copy the URL of into an installation.
>
> I'd rather have it just print the URL rather than awkward text that
> says "take the URL of this page and..."

In pure HTML? No. HTML is for document structure and layout references,
not for generating content. Although JavaScript might do it, it would
be an unreliable solution due to the fact that people can switch off
scripting languages in their browser, or be using a browser that
doesn't support any client-side scripting languages altogether.

The best solution would be to fetch the current URL by using a
server-side scripting language (such as Perl or PHP) or by using SSI
(Server Side Includes).

You can simply use the SERVER_NAME and REQUEST_URI environmental
variables to put together the URL of the current page.

List of common environmental variables and examples using SSI:
http://www.georgedillon.com/web/ssivar.shtml

Introduction to SSI and how to use it:
http://www.georgedillon.com/web/ssi.shtml

--
Kim AndrΓ© AkerΓΈ
- kimandre@NOSPAMbetadome.com
(remove NOSPAM to contact me directly)

 

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

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