<? class functions { private $table; private $db; public function __construct($table = "patient") { $this->table = $table; $this->db = new Database(); } // Ici la suite du code function sanitize_my_email($field) { $field = filter_var($field, FILTER_SANITIZE_EMAIL); if (filter_var($field, FILTER_VALIDATE_EMAIL)) { return true; } else { return false; } } // Envoyer un email public function sendmail($to_email,$subject,$message,$headers) { $to =$to_email; $sujet =$subject; $msg =$message; $head =$headers; //check if the email address is invalid $secure_check $secure_check = sanitize_my_email($to_email); if ($secure_check == false) { echo "Invalid input"; } else { //send email mail($to, $sujet, $msg, $head);
Printf(" TU VEUX APPRENDRE LA PROGRAMMATION");