Treść pliku formularz.php:
<? include('config.php'); #=====================================================# // Funkcja wyświetlająca cały formularz function site_main() { main_title_open(); main_title_close(); main_text_open(); echo ' <form id="zgloszenie" action="email.php" method="post"> <div> Imię:<br> <input name="imie" value="" /><br /> <br> Nazwisko:<br> <input name="nazwisko" value="" /><br /> <br> Dom/funkcja:<br /> <input type="radio" name="funkcja" value="Gryffindor" />Gryffindor<br /> <input type="radio" name="funkcja" value="Hufflepuff" />Hufflepuff<br /> <input type="radio" name="funkcja" value="Ravenclaw" />Ravenclaw<br /> <input type="radio" name="funkcja" value="Slytherin" />Slytherin<br /> <input type="radio" name="funkcja" value="Nauczyciel" />Nauczyciel<br /> <br> <input type="submit" value="Wyslij" name="submit"/> </div> </form> ' ; main_text_close(); } #=====================================================# $site_title = 'Formularz'; $meta_info = ''; include('theme/'.$theme.'/index.php'); ?>
Treść pliku email.php:
<? include('config.php'); #=====================================================# function site_main() { main_title_open(); main_title_close(); main_text_open(); $to = 'dyr.amr@gmail.com'; $subject = 'Zgłoszenie do Ligi Quidditcha'; $message = 'Formularz zgłoszeniowy do Ligi Quidditcha.'; $headers = 'Imię: ' .$_POST['imie'] . "\r\n" . 'Nazwisko: ' .$_POST['nazwisko'] . "\r\n" . 'Dom/funkcja: ' .$_POST['funkcja'] . 'Content-type: text/html; charset=utf-8'; Dziękujemy za wysłanie formularza. <br> <a href="http://ramesville.xaa.pl"><u>Powrót na stronę główna</u></a> '; else echo 'Wystapił bład. Prosimy spróbować ponownie (<a href="formularz.php">Powrót do formularza</a>)'; main_text_close(); } #=====================================================# $site_title = 'Formularz wysłany'; $meta_info = ''; include('theme/'.$theme.'/index.php'); ?>
Czy ktoś ma pomysł, co robię nie tak?