Дело в том что я хочу что-бы "index.php" не перезагружался при обновлении "<input name='new_address' type='text'". И что-бы ошибки выводились перед <form>. index.php <?php $result_city = mysql_query ("SELECT * FROM address WHERE address_code='$select_city'",$db); if (mysql_num_rows($result_city) > 0) { $myrow_city = mysql_fetch_array($result_city); } do { printf ("<style> #boxes%s .window { position:absolute; left:0; top:0; width:440px; height:200px; display:none; z-index:9999; padding:20px; } #boxes%s #dialog%s { width:375px; height:203px; padding:10px; background-color:#ffffff; } </style> <p>%s <a name='modal' href='#dialog%s'>Изменить</a></p> <div id='boxes%s'> <div id='dialog%s' class='window'> Изменение: %s | <a href='#'class='close'>Закрыть его</a> <form action='process.php' method='post'> <input name='new_address' type='text' value='%s' size='15' maxlength='35'> <input name='id' type='hidden' value='%s'> <input name='address_code' type='hidden' value='$select_city'> <input type='submit' name='submit' value='Изменить'> </form> </div> <div id='mask'> </div> </div>",$myrow_city["id"],$myrow_city["id"],$myrow_city["id"],$myrow_city["address_name"],$myrow_city["id"],$myrow_city["id"],$myrow_city["id"],$myrow_city["address_name"],$myrow_city["address_name"],$myrow_city["id"]); } while ($myrow_city = mysql_fetch_array($result_city)); ?> process.php <?php include('blocks/db.php'); if (isset($_POST['new_address'])) { $new_address = $_POST['new_address']; if($new_address == '') { unset($new_address); } } if (isset($_POST['id'])) { $id = $_POST['id']; if($id == '') { unset($id); } } if (isset($_POST['address_code'])) { $address_code = $_POST['address_code']; if($address_code == '') { unset($address_code); } } $new_address = trim($new_address); if (empty($new_address)) { echo "<li>Необходимо указать адрес!</li>"; $error = 1; } if(strlen($new_address)>30) { echo "<li>Минимум 30 символов!</li>"; $error = 1; } if(strlen($new_address)<3) { echo "<li>Не меньше 3 символов!</li>"; $error = 1; } if (!get_magic_quotes_gpc()) { $new_address = addslashes($new_address); } $new_address = htmlspecialchars($new_address); if ($error == 0) { if ($result = mysql_query("UPDATE address SET address_name='$new_address' WHERE id='$id'")) { echo 'Сохранено.'; } else { echo 'Не сохранено.'; } } ?>