ich bin neu im Webdesing und habe meine erste webseite fast fertig.
doch mit dem Php Kontaktformular habe ich noch kieg irgen wie willes nicht funktionieren
was mache ich falsch?
Ich danke euch für eure Hilfe
Gruess Rahel
hier mal meine (kaotischen) Skripts
PHP-Quellcode
- <?php
- $fehler = '';
- if (isset($_POST['firma'])){
- if (trim($_POST['firma']) != ''){
- $firma = $_POST['firma'];
- }else{
- $fehler = $fehler . 'Firma angeben!<br/>';
- }
- if (isset($_POST['name']) && trim($_POST['name']) != ''){
- $name = $_POST['name'];
- }else{
- $fehler = $fehler . 'Name angeben!<br/>';
- }
- if (isset($_POST['telefon']) && trim($_POST['telefon']) != ''){
- $telefon = $_POST['telefon'];
- }else{
- $fehler = $fehler . 'Telefon angeben!<br/>';
- }
- if (isset($_POST['email']) && trim($_POST['email']) != ''){
- $email = $_POST['email'];
- }else{
- $fehler = $fehler . 'E-Mail angeben!<br/>';
- }
- if ($fehler != ''){
- echo $fehler;
- }else{
- echo 'Daten verschicken: ' . $_POST['firma'] . ' ' . $_POST ['name'] . ' ' . $_POST ['telfon'] . ' ' . $_POST ['e-mail'];
- mail('amberrachel@gmx.ch'/*die emailadresse */, 'PHP-emailtest'/*Titel Kontaktformulat*/, $nachricht, /*Nachrischt übernehmen*/'From:' . $email/*header von Benutzer email*/);
- }
- }
- ?>
HTML-Quellcode
- <hr/>
- <form method="post" action="<?php echo $_SERVER['SCRIPT_NAME'] ?>">
- <td align="right">Anrede</td>
- <td><select name="anrede" class="auswahl">
- <option value="firma">Firma</option>
- <option value="herr">Herr</option>
- <option value="frau">Frau</option>
- </select></td>
- </tr>
- <tr>
- <td align="right"><font color=red>*</font>Firma:</td>
- <td><input name="firma" type="text" class="feld" size="30" maxlength="30"></td>
- </tr>
- <tr>
- <td align="right"><font color=red>*</font>Name:</td>
- <td><input name="name" type="text" class="feld" size="30" maxlength="40"></td>
- </tr>
- <tr>
- <td align="right">Position:</td>
- <td><input name="position:" type="text" class="feld" size="30" maxlength="40"></td>
- </tr>
- <tr>
- <td align="right">Strasse/ Nr:</td>
- <td><input name="strasse/ nr" type="text" class="feld" size="30" maxlength="40"></td>
- </tr>
- <tr>
- <td align="right">Postleitzahl:</td>
- <td><input name="postleitzahl" type="text" class="feld" size="30" maxlength="40"></td>
- </tr>
- <tr>
- <td align="right">Stadt:</td>
- <td><input name="stadt" type="text" class="feld" size="30" maxlength="40"></td>
- </tr>
- <tr>
- <td align="right">Land:</td>
- <td><input name="land" type="text" class="feld" size="30" maxlength="40"></td>
- </tr>
- <tr>
- <td align="right"><font color=red>*</font>Telefon:</td>
- <td><input name="telefon:" type="text" class="feld" size="30" maxlength="40"></td>
- </tr>
- <tr>
- <td align="right">Fax:</td>
- <td><input name="Fax" type="text" class="Feld" size="30" maxlength="40"></td>
- </tr>
- <tr>
- <td align="right"><font color=red>*</font>E-mail:</td>
- <td><input name="E-mail" type="text" class="feld" value="@" size="30" maxlength="40"></td>
- </tr>
- <tr>
- <td align="right">Homepage:</td>
- <td><input name="Homaepage" type="text" value="http://"class="feld" size="30" maxlength="40"></td>
- </tr>
- <tr>
- <td align="right" valign="top">Fragen/Bemerkung:</td>
- <td>
- <textarea name="Text" class="Bereich" rows="10" cols="50">
- </textarea></td>
- </tr>
- <tr>
- <td ></td>
- <td><input type="submit" class="Button" value="Absenden" >
- <input type="reset" class="Button" value="Abbrechen"></td></form>
- </tr>