You could even cut the processing down too, by limiting the page load to a certain number of characters…

I mean you don’t need the whole source…

But still – that’s the code, and im sure it would work (I didn’t test it, just wrote it up in outlook)…

 

 

-----------------------------

Chris Stratford

[EMAIL PROTECTED]

www.neester.com

-----------------------------

 

-----Original Message-----
From: Chris Stratford [mailto:[EMAIL PROTECTED]
Sent:
Monday, February 09, 2004 12:51 PM
To: [EMAIL PROTECTED]
Subject: RE: [WSG] W3C VALIDATORS

 


Hey Beau,

 

Well to code it in PHP would be very easy, here is the code:

(Change TICK.JPG to the location of the TICK image, and same for CROSS.JPG)

 

save that script to: validate.php

then link this image:

 

<img src="" border=”0”>

 

CODE:

<?

$fd=fopen("http://validator.w3.org/check?uri=$HTTP_REFERER" ","r");

while ($line=fgets($fd,1000))

{

   $alltext .=    $line;

}

fclose ($fd);

 

if (strpos($alltext, '<h2 id="result" class="valid">'))

{

      header("Location: TICK.JPG");

}else{

      header("Location: CROSS.JPG");

}

?>

 

-----------------------------

Chris Stratford

[EMAIL PROTECTED]

www.neester.com

-----------------------------

 

 

-----Original Message-----
From: Beau [mailto:[EMAIL PROTECTED]
Sent:
Monday, February 09, 2004 12:19 PM
To: [EMAIL PROTECTED]
Subject: Re: [WSG] W3C VALIDATORS

 

 

I think you're semi-onto something Chris, and it actually wouldn't be all that

hard to make it yourself if you were really keen - you could have a script on

your own site which takes the URL value of the page, passes it directly to the

validator (via the querystring) and then parses the result page for keywords

(i.e. 'is valid' or whatever is says when your page validates) and then

display the appropriate image.

 

As you've mentioned tho - it will mean that every page that uses it will be

validated every time it's loaded, unless some sort of caching system is

implemented in parallel.

 

You *might* be able to do something 'cache-y' by relying on the 'Last

Modified:' header that a lot of servers use, so if it hasn't been modified,

then load a previous state for the icon, otherwise validate and display the

result. The problem here again is that you have all this required

communication going back and forth just to display a little icon :)

 

It'd definitely be a nice feature if you could download and install the

validation engine on your own server, and run the tests locally!

 

Cheers (now you've got me thinking...)

 

Beau

 

Chris Stratford said:

> You know, I have been wondering why W3C don't change their CSS &

> HTML/XHTML validators so that they work like this:

>

> You add the image to your website:

>

> <img src="" border="0">

>

> that PHP link will validate your website via the REFERRER value in PHP.

> then the PHP script should return the image!

> Now if it validated - the image should be the TICK, and if it didn't

> validate, it should be an X.

>

> I know the obvious disadvantage - it would use a lot more processing

> than it does already.

> But I am sure they could implement some sort of Caching checksum, so

> that when that specific referrer has a diff checksum or whatnot it

> rescans.

> It would also delay the image load for a few seconds - but that's

> acceptable.

>

> The advantage would be that its instant validation without opening a new

> window.

> And if its an X you can click to see the errors.

>

> Maybe the Processing it would require is way too much - but its an idea!

>

> What do you think.

>

> -----------------------------

> Chris Stratford

>  <mailto:[EMAIL PROTECTED]> [EMAIL PROTECTED]

> www.neester.com <http://www.neester.com/>

> -----------------------------

>

>

 

 

--

Beau Lebens

Information Architect

[EMAIL PROTECTED]

Dented Reality - www.dentedreality.com.au

Information Architecture, Usability, Web Development

*****************************************************

The discussion list for http://webstandardsgroup.org/

*****************************************************

 

 

Reply via email to