Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

how do i aquire the current webpages full url?

Posted on 2007-11-30
2
Medium Priority
?
203 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:Antonio King
2 Comments
 
LVL 20

Accepted Solution

by:
steelseth12 earned 2000 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:Antonio King
ID: 31411949
Fan Dabby Doosie! :D
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
It’s a season to be thankful, and we’re thankful for users like you who engage on site, solve technology problems, and network with others in the industry. What tech are we most thankful for? Keep reading.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Suggested Courses

972 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