It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming PHP and MySQL Forum

w3c service validator

Moderator: Malcolm

w3c service validator

Postby katerina on Thu Oct 02, 2008 11:04 am

Hi, I need your help in php.

I save an url in a variable (let $url)

I want to check the page, so I use a w3c site :

<?php
echo '<a href="http://validator.w3.org/check?uri='.$url.'">Elegxos</a>';
?>

I would like if there are errors to print 'I found % errors and % warnings'
or print 'I did't find errors'.

Could someone help me ?
katerina
 
Posts: 4
Joined: Sun Sep 28, 2008 1:56 pm

Postby nighthawk on Sat Oct 04, 2008 8:09 am

You should check first if it's legal to take page content like that from w3c.

Basically you'll need to use file_get_contents('http://validator.w3.org/check?uri='.$url.'); to get entire page, and then something like strpos and substr to pull out the content you want.
The Zeitgeist Movement
User avatar
nighthawk
250+ Club
 
Posts: 420
Joined: Sun Jun 11, 2006 1:53 pm
Location: SFRJ

Postby katerina on Sat Oct 04, 2008 8:35 am

thanks a lot. I

dit it with file_get_contents and preg_match function!
katerina
 
Posts: 4
Joined: Sun Sep 28, 2008 1:56 pm


Who is online

Users browsing this forum: No registered users and 0 guests