Solved

how do i aquire the current webpages full url?

Posted on 2007-11-30
2
148 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

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.
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

746 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now