if ($action==send) { $msg_erreur = ""; $output = "\n"; $output .= "\t\n"; for($x=0;$x<$_POST['counter'];$x++){ $headline = "headline_".$x; $date = "date_".$x; $description = "description_".$x; $delete = "delete_".$x; if (!$_POST["".$delete.""]) { $newheadline = trim($_POST["".$headline.""]); $newdate = trim($_POST["".$date.""]); $newdescription = trim($_POST["".$description.""]); if ( (empty($newheadline)) || (empty($newdate)) || (empty($newdescription)) ) { $msg_erreur .= "-Vous n'avez pas rempli tous les champs de la news ".$newheadline.""; } else { $newheadline=htmlentities(stripslashes($newheadline)); $newdescription=htmlentities(stripslashes($newdescription)); $output.="\t\t\r\n"; $output.="\t\t\t"; $output.=$newheadline; $output.="\r\n"; $output.="\t\t\t"; $output.=$newdate; $output.="\r\n"; $output.="\t\t\t"; $output.=$newdescription; $output.="\r\n"; $output.="\t\t\r\n"; } } } echo $output; }