Output checks

Some mistakes only show in the finished HTML: two elements with the same id, an image without alt text, a form field nothing labels, a link to a page that does not exist. With $padCheckOutput = TRUE in _config/config.php, PAD reads every local HTML response back once it has rendered and names them.

PHP
fragments/output_checks_1.php
HTML
fragments/output_checks_1.pad
Result
<?php

$findings
= padOutputCheck ( '<img src="logo.png"><input name="email"><a href="?no_such_page">More</a>' );

?>
<ul>
{findings}<li>{$findings}</li>{/findings}
</ul>
  • <img src="logo.png"> has no alt text
  • <input name="email"> has no label
  • <a href="?no_such_page"> is a broken link: there is no page 'no_such_page'