<?php

// Powered by Beshoori Software Development & Network

//http://www.beshoori.de

//Ehab Beshoori

?>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />



<div style="width: 550px;">

     <?php

     if(isset($_POST['Submit'])){





       $name=strip_tags($_POST['name']);

       $nachname=strip_tags($_POST['nachname']);

       $firma=strip_tags($_POST['firma']);

       $strasse=strip_tags($_POST['strasse']);

       $plz=strip_tags($_POST['plz']);

       $stadt=strip_tags($_POST['stadt']);

       $nation=strip_tags($_POST['nation']);

       $telefonnummer=strip_tags($_POST['telefonnummer']);

       $mobilfunknummer=strip_tags($_POST['mobilfunknummer']);

       $email=strip_tags($_POST['email']);

       $anfrage=strip_tags($_POST['anfrage']);



       if(strlen($name)<3){

       $error_msg="Please enter your name.<br>";

       }



       if(strlen($nachname)<3){

       $error_msg="Please enter your surname.<br>";

       }



       if(!filter_var($email, FILTER_VALIDATE_EMAIL)){

       $error_msg.="Please enter a valid email address.<br>";

       }



       if(strlen($anfrage)<3){

       $error_msg.="Bitte geben Sie an, welche Anfrage Sie an uns richten m�chten.<br>";

       }



       if(isset($error_msg))

        {

          echo "Sorry, your request could not be processed for the following reasons:<br><br>";

          echo $error_msg;

          echo "<br>Please click <a href=javascript:history.back(1)>zurück</a> and fill in all required fields.";

        }

       else

        {

          $recipient="homepage@chateau-royal";

          $subject="Eine Anfrage aus dem englische Webseite";

          $header="From: " . $email . "\r\n";

          $mail_body ="Das Anfrage-Formular wurde am " . date("d.m.Y") . " um " . date("H:i") . "h gesendet.\n";

          $mail_body.="Folgende Werte wurden eingetragen:\n\n";

          $mail_body.="Name: " . $name . "\n";

          $mail_body.="Nachname: " . $nachname . "\n";

          $mail_body.="Firma: " . $firma . "\n";

          $mail_body.="Strasse: " . $strasse . "\n";

          $mail_body.="Plz: " . $plz . "\n";

          $mail_body.="Stadt: " . $stadt . "\n";

          $mail_body.="Nation: " . $nation . "\n";

          $mail_body.="Telefonnummer: " . $telefonnummer . "\n";

          $mail_body.="Mobilfunknummer: " . $mobilfunknummer . "\n";

          $mail_body.="E-Mail: " . $email . "\n\n";

          $mail_body.="Anfrage:\n";

          $mail_body.=$anfrage . "\n\n ---- Ende der automatisch generierten eMail ----";

          mail($recipient,$subject,$mail_body,$header);

         //Formular ausgeführt und Meldung ausgeben

          echo "Thank you for your contact.";

        }



     }else{



     ?>





      <form action="<?php $_SERVER['PHP_SELF'] ?>" method="POST">



          <table border="0" cellspacing="2" cellpadding="2" style="width: 95%; font-family: Arial; font-size: 10pt; font-weight: bold;">

            <tr>

              <td  style="width: 10px">

              </td>

              <td  style="width: 90px">

                Company

              </td>

              <td style="width: 150px">

                <input type="text" name="firma" size="35" style="color: #999 ; width :140px" value=""/>

                </td>

              <td style="width: 120px">

                Postal code

              </td>

              <td>

                <input id="Text3" size="35" type="text" name="plz" style="color: #999 ; width :140px"  value="" />

              </td>

            </tr>

            <tr>

              <td  style="width: 10px">

              </td>

              <td  style="width: 90px">

                Name *

              </td>

              <td style="width: 150px">

                <input id="Text8" size="35" type="text" name="name" style="color: #999 ; width :140px"  value="" />

              </td>

              <td style="width: 120px">

                Nation

              </td>

              <td>

                <input id="Text5" size="35" type="text" name="nation" style="color: #999 ; width :140px"  value="" />

              </td>

            </tr>

            <tr>

              <td  style="width: 10px">

              </td>

              <td  style="width: 90px">

                Surname *

              </td>

              <td style="width: 150px">

                <input id="Text1" size="35" type="text" name="nachname" style="color: #999 ; width :140px"  value="" />

              </td>

              <td style="width: 120px">

                Phone

              </td>

              <td>

                <input id="Text6" size="35" type="text" name="telefonnummer" style="color: #999 ; width :140px"  value="" />

              </td>

            </tr>

            <tr>

              <td  style="width: 10px">

              </td>

              <td  style="width: 90px">

                Street

              </td>

              <td style="width: 150px">

                <input id="Text2" size="35" type="text" name="strasse" style="color: #999 ; width :140px"  value="" />

              </td>

              <td style="width: 120px">

                Mobile nummber

              </td>

              <td>

                <input id="Text7" size="35" type="text" name="mobilfunknummer" style="color: #999 ; width :140px"  value="" />

              </td>

            </tr>

            <tr>

              <td  style="width: 10px">

              </td>

              <td  style="width: 90px">

                City

              </td>

              <td style="width: 150px">

                <input id="Text4" size="35" type="text" name="stadt" style="color: #999 ; width :140px"  value="" />

              </td>

              <td style="width: 120px">

                E-Mail address *

              </td>

              <td>

                <input type="text" name="email" size="35" style="color: #999 ; width :140px"  value="">

              </td>

            </tr>

          </table>

        <table cellpadding="2" cellspacing="2" style="width: 95%;  font-family: Arial; font-size: 10pt; font-weight: bold;">

          <tr>

            <td style="width: 10px">

            </td>

            <td style="width: 90px">

              Your message<br />

              <br />

              <br />

              <input type="submit" name="Submit" value="Send" style="font-weight: bold; width: 83px; color: #330066">

            </td>

            <td>

              <textarea name="anfrage" style="height: 80px; font-family: Arial; font-size: 10pt; color: #999 ; width :420px"></textarea>

            </td>

          </tr>

        </table>



      </form>

      <?php

      }

      ?>

    </div>

