Emulating validation pages
Posted: Sun Aug 28, 2005 10:08 pm
I would like to know what the headers are that http://validator.w3.org sends so that I can make a custom page validator. Basically I am doing this so that the sessions variables work too, because obviously when the validator goes to a restricted part of the site, it simply gets a "you must be logged in" error. Thanks.
[Edit] I think that explanation sucked. I want to somehow include in a script the page that the user wants to get validated. [the url has been base64 encode] So basically, when they do so, it uses the regular validation headers to be sent to my pages, saves that output as a file, then redirects to the validator:
I'm trying to figure out what to put inbetween the commented lines so that the session vars will be sent and the validation headers will be sent.
[Edit] I think that explanation sucked. I want to somehow include in a script the page that the user wants to get validated. [the url has been base64 encode] So basically, when they do so, it uses the regular validation headers to be sent to my pages, saves that output as a file, then redirects to the validator:
Code: Select all
<?
$url = base64_decode( $_GET['q'] );
ob_start( );
////////////////////////
include "http://www.chatlance.com$url";
///////////////////////
$contents = ob_get_contents();
ob_end_clean();
$file = "/***************/Validation/".md5(time()).".htm";
$hnd = fopen( $file, "w" );
fwrite( $hnd, $contents );
fclose( $hnd );
header( "Location: http://validator.w3.org/check?uri=".urlencode("http://www.chatlance.com/".substr($file,27)).";ss=1" );
?>