curiouscat.comCurious Cat Code
curiouscat.com > code > CGI > Get URL
Purpose: To get the URL (unique address) of the current web page
Code: CGI, HTML

Most web servers have CGI (Common Gateway Interface) variables that you can use to get the URL of the current web page.
To get the URL you need to get two of these variables: SERVER_NAME and PATH_INFO.
For this page:
SERVER_NAME: www.curiouscat.com
PATH_INFO: /code/geturl.cfm

How can this be useful? This information can be used if you have a piece of code on various pages and you want to use the current URL in that code. Rather than having to manually put that in for each page you use the code on you can just use a variable to stand for the URL.

© 1996-2008   curiouscat.com      Feedback - Contact Us
Curious Cat web site by Curious Cat Creations. We can help create or improve your online presence.