Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

how do i aquire the current webpages full url?

Posted on 2007-11-30
2
Medium Priority
?
196 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

The top UI technologies you need to be aware of

An important part of the job as a front-end developer is to stay up to date and in contact with new tools, trends and workflows. That’s why you cannot miss this upcoming webinar to explore the latest trends in UI technologies!

Question has a verified solution.

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

Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

705 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