open(); foreach ($table as $var) { if ( getpost( $var ) != null ) { $r = getpost( $var ); /*if ( $r == "true") { $r = 1; }elseif( $r ="false")*/ $db->$var = trim($r, ' \"'); }else { $erreur[] = $var; } } if (!empty ($erreur)) { echo json_encode($erreur); }else { $db->newPlane(); } $db->close(); ?>