Stworzylem prosty formularz kontaktowy do rezerwowania spotania w studiu tatuazu. Po wypelnieniu formularza i wyslaniu formularza powinna wyswietlic sie nastepna strona z informacja dla uzytkownika a pojawia sie bialy ekran ze stopka strony ktora powinna sie wyswietlic. Szukalem bledu ale nie moge nic znales. moze mi ktos pomoc z naprawa tego?
To jest kod pliku z formularzem:
date_default_timezone_set('Europe/London'); ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>.:Fallen Angels Tatto and Bodypiercing:.</title> <link rel="stylesheet" href="themes/blackandwhite.min.css" /> <link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.1/jquery.mobile.structure-1.3.1.min.css" /> <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script> <script src="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.js"></script> </head> <body> <div data-role="page" data-theme="a"> <div data-role="header"> <h1>Fallen Angels</h1> <div data-role="navbar"> <ul> <li><a href="menu.php" data-transition="slide" data-icon="home" data-iconpos="left">Main menu</a></li> </ul> </div><!-- /navbar --> </div><!-- /header --> <div data-role="content" align="center"> <?php { $user = $_SESSION['username']; if (!$con) { } } else ?> <h3>Book an appoiment</h3> <form name="bookingform" method="post" action="book_appoiment.php"> <div id="form-content"> <fieldset> <div class="fieldgroup"> <label for="first_name">First name<small>(This field is required)</small></label> <input type="text" name="first_name" value=""> </div> <div class="fieldgroup"> <label for="last_name">Surname<small>(This field is required)</small></label> <input type="text" name="last_name" alue=""> </div> <div class="fieldgroup"> <label for="email">E-mail <small>(This field is required)</small></label> <input type="text" name="email" alue=""> </div> <div class="fieldgroup"> <label for="telephone">Telephone <small>(This field is required)</small></label> <input type="text" name="telephone"> </div> <div class="fieldgroup"> <label for="date">Date<small>(This field is required)</small></label> <input type="text" name="date"> </div> <div class="fieldgroup"> <label for="type" class="select">What do you want?</label> <select name="type" id="select-choice-1"> <option value="tattoo">Tattoo</option> <option value="bodypiercing">Bodypiercing</option> <option value="information">Information</option> </select> </div> <div class="fieldgroup"> <label for="comments">Comments:</label> <textarea cols="40" rows="10" name="comments" id="textarea"></textarea> </div <div class="fieldgroup"> <input type="submit" value="Book appoiment" class="submit"> </div> </fieldset> </div> </form> </div><!-- /content --> <a href="logout.php" data-role="button">Logout</a> <div data-role="footer" data-position="fixed"> <h4>Fallen Angels 2013. All right reserved.</h4> </div><!-- /footer --> </div><!-- /page --> </body> </html>
A to jest kod pliku z funkcja wysylania emaila i strona z podziekowaniami:
<?php date_default_timezone_set('Europe/London'); // EDIT THE 2 LINES BELOW AS REQUIRED $email_to = "przystup@gmail.com"; $email_subject = "New appoiment booking form Mobile App"; function died($error) { // your error code can go here } // validation expected data exists died('We are sorry, but there appears to be a problem with the form you submitted.'); } $first_name = $_POST['first_name']; // required $last_name = $_POST['last_name']; // required $email_from = $_POST['email']; // required $telephone = $_POST['telephone']; // not required $telephone = $_POST['date']; // not required $telephone = $_POST['type']; // not required $comments = $_POST['comments']; // required $error_message = ""; $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/'; $error_message .= 'The Email Address you entered does not appear to be valid.<br />'; } $string_exp = "/^[A-Za-z .'-]+$/"; $error_message .= 'The First Name you entered does not appear to be valid.<br />'; } $error_message .= 'The Last Name you entered does not appear to be valid.<br />'; } $error_message .= 'The telephone number you entered does not appear to be valid.<br />'; } $error_message .= 'The date you entered does not appear to be valid.<br />'; } $error_message .= 'The type of bookin you entered does not appear to be valid.<br />'; } died($error_message); } $email_message = "Form details below.\n\n"; function clean_string($string) { } $email_message .= "First Name: ".clean_string($first_name)."\n"; $email_message .= "Last Name: ".clean_string($last_name)."\n"; $email_message .= "Email: ".clean_string($email_from)."\n"; $email_message .= "Telephone: ".clean_string($telephone)."\n"; $email_message .= "Date: ".clean_string($date)."\n"; $email_message .= "Booking for: ".clean_string($type)."\n"; $email_message .= "Comments: ".clean_string($comments)."\n"; // create email headers $headers = 'From: '.$email_from."\r\n". 'Reply-To: '.$email_from."\r\n" . ?> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>.:Fallen Angels Tatto and Bodypiercing:.</title> <link rel="stylesheet" href="themes/blackandwhite.min.css" /> <link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.1/jquery.mobile.structure-1.3.1.min.css" /> <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script> <script src="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.js"></script> </head> <body> <div data-role="page" data-theme="a"> <div data-role="header"> <h1>Fallen Angels</h1> <div data-role="navbar"> <ul> <li><a href="menu.php" data-transition="slide" data-icon="home" data-iconpos="left">Main menu</a></li> </ul> </div><!-- /navbar --> </div><!-- /header --> <div data-role="content" align="center"> <?php { $user = $_SESSION['username']; if (!$con) { } } else ?> <p> Thanks for booking an appoiment. We will confirm by phone or email in 24h</p> </div><!-- /content --> <a href="logout.php" data-role="button">Logout</a> <div data-role="footer" data-position="fixed"> <h4>Fallen Angels 2013. All right reserved.</h4> </div><!-- /footer --> </div><!-- /page --> </body> </html> <?php } ?>