Alan Edwardes

SERVER REQUEST URI

If you are like me, you probably keep a "Validation" button somewhere to hand. Wherever it is, it will probably look something like this:

<a href="http://validator.w3.org/check/referer" title="Validation tests" >Validation Tests</a>

This method is fine, until you get the "No Referrer header found!" page, which is very annoying. A simple resolution to this is to use the <?php echo $_SERVER['REQUEST_URI']; ?> code. This helpful bit of code will insert the address of the page the user is currently on, so if you were on "http://test.com/pages/test/" the code would copy the "/pages/test/". To use it in the code:

<a href="http://validator.w3.org/check?uri=http://yoursite.com&lt;?php echo $_SERVER['REQUEST_URI']; ?&gt;" title="Validation tests">Validation Tests</a>

28th of June 2006 at 6:22 PM

5 years, 10 months ago

written by Alan Edwardes.

104 words

rand: Splooshe Alpha #2

next: Google - Its a wonderful ...

prev: Revised: Bad old Paint!

share:FacebookTwitterRedditdiggStumbleUpondeliciousHacker NewsLinkedIn

Add a Comment

© 2006 – 2012 Alan Edwardes / code on github
Top