mcliquid Moderator

Anmeldedatum: 20.06.2007 Beiträge: 75 Wohnort: Markdorf
|
Verfasst am: 21.06.2007, 22:45 Titel: Kontakt formular mit PHP und vielen Funktionen |
|
|
So ein Formular mit:
Name:
Email:
ICQ:
MSN
Website:
Betreff:
IP:
Nachricht:
Datum:
Bitte Copyright beachten ! Wer Probleme hat oder eigene Felder bitte bei mir über www.mcliquid.de -> Contact ausfüllen! Mache ich gerne und gratis!
| Code: |
<?php
// E-Mail-Adresse an die gesendet werden soll
$empfaenger = "deine-email-adresse@domain.de";
// AB HIER NICHTS MEHR ÄNDERN, AUßER MAN WEIß WAS MAN TUT!
$name = $_POST["name"];
$email = $_POST["email"];
$icq = $_POST["icq"];
$msn = $_POST["msn"];
$website = $_POST["website"];
$betreff = $_POST["betreff"];
$ip = $_POST["ip"];
$nachricht = $_POST["nachricht"];
$datum = date("d.m.Y");
$zeit = date("H:i");
$ip_ermitteln = $_SERVER["REMOTE_ADDR"];
$ausgabe = "Datum: $datum / Zeit: $zeit Uhr
-----------------------------------------------------------------
Name: $name
E-Mail: $email
ICQ: $icq
MSN: $msn
Website: $website
-----------------------------------------------------------------
Betreff: $betreff
IP: $ip
-----------------------------------------------------------------
Nachricht:
$nachricht";
if($_POST["submit"]){
if(empty($name) OR empty($email) OR empty($betreff) OR empty($nachricht) OR empty($ip)){
echo "<div style=\"font-weight: bold; text-align: center; color: #FF0000;\">Füllen Sie bitte alle Pflichtfelder aus.</div><br />";
} else {
mail($empfaenger, $betreff, $ausgabe, "FROM: $email");
echo "<div style=\"font-weight: bold; text-align: center; color: #00FF00;\">Ihre Nachricht wurde erfolgreich versandt.</div><br />";
}
}
?>
<style type="text/css">
body, td { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #000000; }
.input { width: 300px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #000000; border: 1px solid #555555; background: #FAFAFA; }
.inputbutton { width: 148px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #000000; border: 1px solid #555555; background: #FAFAFA; }
.copyright { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #000000; text-align: center; }
</style>
<form name="Kontakt" method="post" action="">
<table width="490" border="0" align="center" cellpadding="0">
<tr>
<td width="20%"><b>Name: *</b></td>
<td width="80%">
<input name="name" type="text" class="input" />
</td>
</tr>
<tr>
<td><b>E-Mail: *</b></td>
<td><input name="email" type="text" class="input" /></td>
</tr>
<tr>
<td><b>ICQ:</b></td>
<td><input name="icq" type="text" maxlength="9" class="input" /></td>
</tr>
<tr>
<td><b>MSN:</b></td>
<td><input name="msn" type="text" class="input" /></td>
</tr>
<tr>
<td><b>Website:</b></td>
<td><input name="website" type="text" value="http://" class="input" /></td>
</tr>
<tr>
<td><b>Betreff: *</b></td>
<td><input name="betreff" type="text" class="input" /></td>
</tr>
<tr>
<td><b>Nachricht: *</b></td>
<td><textarea name="nachricht" rows="5" class="input"></textarea></td>
</tr>
<tr>
<td><b>* - Pflichtfelder</b></td>
<td><input name="submit" type="submit" value="Abschicken" class="inputbutton" /> <input name="reset" type="reset" value="Zurücksetzen" class="inputbutton" /><input name="ip" type="hidden" value="<?php echo $ip_ermitteln; ?>" /></td>
</tr>
</table>
</form>
<br />
//COPYRIGHT !!! BY www.mcliquid.de
//BITTE BEACHTEN!!!!
<div class="copyright">Powered by <a href="http://www.mcliquid.de" target="_blank">mcliquid.de</a></div> |
_________________
Andre Thum - Web | Photo | Kommunikation
mcliquid.de Blog |
|