PHP Code:
if ($_POST) {
if (!empty($_POST['name']))
{
//codes
echo $_POST['name'].'<br />';
} else
$eror[]="error message";
if (preg_match('$regex',$_POST['email']))
{
// codes
echo $_POST['email'];
} else $eror[]="error message";
}
when error occured how will we assign mesages into array and automatically wil send array to y.php