If you think I shouldn't use regex, but something like xpath, say how.That would be something like
<?php
$doc = new DOMDocument;
if ( !$doc->loadhtml($contents) ) {
echo 'something went wrong';
}
else {
$xpath = new DOMXpath($doc);
foreach($xpath->query('//form[@name="aspnetForm"]//input') as $eInput) {
echo 'name=', $eInput->getAttribute('name'), ' value=', $eInput->getAttribute('value'), "\n";
}
}
If you get annoying warning messages you might want to use @$doc->loadhtml($contents); maybe in conjuction with libxml_use_internal_errors() and libxml_get_errors()
VolkerK
2009-07-08 21:19:57