möcht euch was fragen, da ich ein problem habe weiter zumachen.
mein problem war/ist dass das require,function is_mail nicht funktioniert.
und noch so andere dinge, ich hoffe ihr könnt mir auch noch vorschläge geben was man noch verbessern muss oder kann.
übrigens muss ich noch sagen dass ich noch voll in der Lern phase bin.
hier der code:
- Code: Alles auswählen
<link rel="stylesheet" type="text/css" href="CSS/ContactLayout.css"/>
<h1>Beispiel fürs Original Formular</h1>
<div id="kontaktfeld">
| <a href="ausloggen.php">Ausloggen</a>
<?php
require ('kennwortschutz.php');
if (isset ( $_GET['mail']) <> "")
{
}
function is_mail ( $testmail ) {
$searchmuster = "/^[-\w.]+@([A-z0-9][-A-z0-9]+\.)+[A-z]{2,4}$/";
$erg = preg_match ($searchmuster, $testmail);
return ($erg > 0);
}
if (isset ( $_GET['anrede']) == "" or $_GET['nachname'] == "" or $_GET['vorname'] == "" or $_GET['str'] == "" or $_GET['plz'] == "" or $_GET['mail'] == "" or $_GET['nachricht'] == "" )
{
// Formular Beginn
echo '<form method="get" action="Beispiel-formular-fuers-original.php">';
echo '<h1>Kontakt:</h1><br />';
echo 'Felder mit * müssen angegeben werden.<br />';
echo '<br />';
if (isset ( $_GET['gesendet']) == "ja" )
{
echo '<p><h2>Hinweis: Das Formular ist unvollständig. Bitte alle Felder Kontrollieren und nach korrigieren.</h2></p>';
if ( is_mail($_GET['mail']) == false)
{
echo "<p><h2>Hinweis: E-Mail Adresse ist Ungültig! Bitte Kontrollieren und nach korrigieren.</h2></p>";
$_GET['mail'] = "";
} }
echo '<br /><br /><br />';
//Formular Felder Beginn
echo '<label>Anrede: *</label>';
echo '<select name="anrede" id="anrede">
<option value="m">Herr </option>
<option value="w">Frau </option></select><br />';
echo '<br />';
echo '<label>Nachname: *</label>';
echo '<input type="text" name="nachname" value="" /><br />';
echo '<label>Vorname: *</label>';
echo '<input type="text" name="vorname" value=""/><br />';
echo '<label>Firma:</label>';
echo '<input type="text" name="firma" value=""/><br />';
echo '<label>Straße / Nr: *</label>';
echo '<input type="text" name="str" value=""/><br />';
echo '<label>PLZ / Ort: *</label>';
echo '<input class="small" type="text" name="plz" value=""/>
<input class="medium"type="text" name="plz" value=""/><br />';
echo '<label>Telefon:</label>';
echo '<input class="small" type="text" name="tel" value="+41"/>
<input class="medium"type="text" name="tel" value=""/><br />';
echo '<label>E-Mail: *</label>';
echo '<input type="text" name="mail" value=""/><br />';
echo '<label>Nachricht: *</label>';
echo '<textarea name="nachricht" id="nachricht" rows="20" cols="42"></textarea>';
echo '<br />';
echo '<br />';
echo '<input type="hidden" name="gesendet" value="ja"/>';
echo '<input class="submitbutton" type="submit" value="Absenden"/>';
echo '</form>';
//Formular Felder END
// Formular END
}
else
{
echo '<h1>Vielen dank...</h1>';
echo '<p>Vielen Dank für Ihre Nachricht</p>';
$empfaenger ="@gmx.net";
$inhaltbetreff ="Anfrage von Website" .$_GET['anrede'] = $_GET['nachname'] = $_GET['vorname'];
$inhaltmail ="Anfrage von E-Mail";
}
?>
</div>