function form_rejestracji(){ ?> <form method=post action=rejestracja.php> <table border="0"> <tr><td>Email: </td><td><input type=text name=email></td></tr> <tr><td>Hasło: </td><td><input type=password name=haslo1></td><td> 8-12 znaków</td></tr> <tr><td>Powtórz hasło: </td><td><input type=password name=haslo2></td> <tr><td colspan="2" align=right><input type=submit value="Wyślij"></td></tr> </table> </form> <? }
function rejestruje(){ $email=$_POST['email']; $haslo1=$_POST['haslo1']; $haslo2=$_POST['haslo2']; //session_start(); try { if (!wypelniony($_POST)){ throw new Exception ('Wypełnij wszystkie pola'); } if (!prawidlowy_email($email)){ throw new Exception ('Nieprawidłowy email'); } } catch (Exception $e){ exit; } } ?>
i