<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
include_once('simple_html_dom.php');
$city = (isset($_POST['city'])) ? $_POST['city'] : '';
?>
<form name="form1" method="post" action="">
<input type="text" name="city" id="city" value="<?php echo $city; ?>">
<input type="submit" name="Submit" value="Invia">
</form>
<?PHP
if(isset($_POST['city'])) {
$city = $_POST['city'];
echo '<table width="100%" border="1" cellspacing="5" cellpadding="5">';
for($i=0;$i<=5;$i++) {
$html = new simple_html_dom();
// Load a file
$html->load_file('http://www.avivaitalia.it/locator/all?circle_op=%3C&circle[value]=35&circle[location]='.$city.'&page='.$i.'');
# get an element representing the second paragraph
foreach($html->find("table") as $e) {
echo $e->innertext.'';
}
}
echo '</table>';
}
?>