When your site validates correctly using the W3C validation tool, you get code to place an image and link on your website which allows anyone to confirm that validation. This relies on your browser sending the "referrer" HTML header. This small PHP version of the W3C logo allows you to check any page even if the referrer header is not supported.

Original W3C Code

<p>
	<a href="http://validator.w3.org/check?uri=referer"><img
		src="http://www.w3.org/Icons/valid-html401"
		alt="Valid HTML 4.01 Strict" height="31" width="88"></a>
</p>
 
Get Code

As you can see, this passes the uri to the W3C validator via the "uri" variable, which can be "referrer" or a valid uri.

Automatic Code for Any Page

<?php
	$_url="http://www.".$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
 
	echo(	'<a href="http://validator.w3.org/check?uri='.$_url.'">
			<img	src="http://www.w3.org/Icons/valid-html401"
			alt="Valid HTML 4.01 Strict" height="31" width="88"></a>'
		);
?>
Get Code

So we use some basic PHP to ensure that the link works whether or not your browser passes the "referrer" link. Of course, if you display this image, you should validate any changes to your web site to ensure that it really is valid!