Solved

how do i aquire the current webpages full url?

Posted on 2007-11-30
2
180 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 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:Antonio King
ID: 31411949
Fan Dabby Doosie! :D
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
This article discusses how to implement server side field validation and display customized error messages to the client.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

726 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