Fragment includowanie w index.php
<?php if($_GET['id']=="kontakt") { include("kontakt.php"); } elseif ($_GET['id']=="uslugi"){ include("uslugi.php"); } else{ include("main.php"); } ?>
plik kontakt.php
<?php // EDIT THE 2 LINES BELOW AS REQUIRED $email_to = "pastucha.lukasz@gmail.com"; $email_subject = "Biuro rachunkowe \"Kaja\""; function died($error) { // your error code can go here } // validation expected data exists if ( ) { died('Proszę wypełnić wszystkie pola'); } $email_from = $_POST['email']; // required $comments = $_POST['comments']; // required $error_message = ""; $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/'; $error_message .= 'Niepoprawny e-mail<br />'; } $error_message .= 'The Comments you entered do not appear to be valid.<br />'; } died($error_message); } function clean_string($string) { } $email_message .= "Email: " . clean_string($email_from) . "\n"; $email_message .= " " . clean_string($comments) . "\n"; // create email headers $headers = 'From: ' . $email_from . "\r\n" . 'Reply-To: ' . $email_from . "\r\n" . } ?>
<div class="dane_kontaktowe"> <div class="top_title"> </div> <p> Biuro rachunkowe "Kaja"<br> Nietkowice 89<br> 66-100 Sulechów <br> </p> </div> <div class="contact_form"> <form name="contactform" method="post" action="kontakt.php"> <div class="box" > <label for="email"> <input type="text" class="wpis" name="email" id="email" /> <br /> </label> <textarea class="message" name="comments" id="message"> <input name="submit" type="submit" class="button" value="Wyślij" id="submit"/> </label> </div> </form> </div>