Posts

Showing posts from November, 2006

W3 Validator, DOM, byteson and PHP

I've uploaded a new byteson example page, based on a single and simple request to a PHP page that uses W3 Validator service, calling a SOAP result, parse them to convert it into an associative array and finally send it with JSON to byteson. Here is the PHP code <?php // byteson filter if(isset($_POST['byteson'])) { // http://www.phpclasses.org/browse/package/3512.html require 'FastJSON.class.php'; // http://www.devpro.it/code/143.html require 'W3validator.function.php'; // remove magic quotes if th it's present // magic_quotes is a problem for JSON strings if(get_magic_quotes_gpc()) $_POST['byteson'] = stripslashes($_POST['byteson']); // get the output $output = FastJSON::encode(W3validator(FastJSON::decode($_POST['byteson']))); // force new content to download header('Content-Type: text/plain; charset=utf-8'); header('Content-Length: '.strlen($output)); header('Expires: Mon, 26 Jul 19