Solved

how do i aquire the current webpages full url?

Posted on 2007-11-30
2
164 Views
Last Modified: 2010-04-21
I have two links in the footer of my website.
<a href="http://jigsaw.w3.org/css-validator/validator?uri=http://www.blablabla.com/css.css">valid css</a>

and

<a href="http://validator.w3.org/check?uri=http://www.blablabla.com">

however, whenever a user changes page the links in the footer maybe pointing to a location not relevant to the page the user is currently on.

My question is, how do I replace http://www.blabla.com with the actual full url of the page the user is on?
0
Comment
Question by:Alan-Yeo
2 Comments
 
LVL 20

Accepted Solution

by:
steelseth12 earned 500 total points
ID: 20383201
to get the current url use

print "http://".$_SERVER['HTTP_HOST']."/".$_SERVER['PHP_SELF'].($_SERVER['QUERY_STRING']?"?".$_SERVER['QUERY_STRING']:"");
0
 

Author Closing Comment

by:Alan-Yeo
ID: 31411949
Fan Dabby Doosie! :D
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question