Hallo
Ich habe mal das Debugging gemacht, ich hoffe, ich habe es korrekt gemacht!
http://irep.freehoster.ch/test.php
Ich habe ein Kontaktformular auf meiner Page. Wenn ich nun auf absenden klicke dan kommt immer ''Es ist ein Fehler aufgetreten!'' Das hab ich umbennant auf ''Das Kontaktformular ist noch nicht im Betrieb'' dass es besser ausschaut.
hier wäre mal mein komplettes Script :
PHP-Code:
<head>
<title>
<div align="center">Kontaktformular</div>
</title>
<div align="center">
</head>
<body style="background:#;color:#;font-size:;font-family:;">
<?php
$v0 = $_POST ["0"];$v1 = $_POST ["1"];$v2 = $_POST ["2"];$v3 = $_POST ["3"];$v4 = $_POST ["4"];$v5 = $_POST ["5"];$v6 = $_POST ["6"];$v7 = $_POST ["7"];$v8 = $_POST ["8"];
$datum = date("d.m.Y");
$uhrzeit = date("H:i");
$mitteilung="Hallo, am $datum wurde eine Nachricht ü;ber Ihr Kontaktformular an Sie versendet. Inhalt: Anrede: ".$v1." Name: ".$v2." Nachname: ".$v3." Telefon: ".$v4." E-Mail: ".$v5." Betreff: ".$v6." Antwort: ".$v7." Mit freundlichen Grü;ßen";
$mail="dean.aeli@gmail.com";
$send=$_POST['s'];
function random($name_laenge) {
$zeichen = "abcedfhiklmnorstuvwxzABCDEFGHIJKLMNOPRTSUVWXYZ0123456789";
$name_neu = "";
mt_srand ((double) microtime() * 1000000);
for ($i = 0; $i < $name_laenge; $i++ ) {
$name_neu .= $zeichen{mt_rand (0,strlen($zeichen))};
}
return $name_neu;
}
$zufall = random(4);
$zufall2 = $zufall;
$code = $zufall2;
if(($send!="1"))
{
?>
</div>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<div align="center">
<table id="tableOne" border="0" cellpadding="0" cellspacing="5">
<tbody><tr><td colspan="2"> <h1>Kontaktformular</h1> </td></tr><tr> <td>Anrede:</td><td><select style="border: 1px solid rgb(0, 0, 0); font-family: arial; font-size: 12px; height: 20px; width: 200px; background-color: rgb(255, 255, 255); color: rgb(0, 0, 0);" name="1" id="1"><option value="Herr">Herr</option><option value="Frau">Frau</option></select></td> </tr><tr> <td>Name:</td><td><input style="border: 1px solid rgb(0, 0, 0); font-family: arial; font-size: 12px; height: 20px; width: 200px; background-color: rgb(255, 255, 255); color: rgb(0, 0, 0);" name="2" type="text"></td> </tr><tr> <td>Nachname:</td><td><input style="border: 1px solid rgb(0, 0, 0); font-family: arial; font-size: 12px; height: 20px; width: 200px; background-color: rgb(255, 255, 255); color: rgb(0, 0, 0);" name="3" type="text"></td> </tr><tr> <td>Telefon:</td><td><input style="border: 1px solid rgb(0, 0, 0); font-family: arial; font-size: 12px; height: 20px; width: 200px; background-color: rgb(255, 255, 255); color: rgb(0, 0, 0);" name="4" type="text"></td> </tr><tr> <td>E-Mail:</td><td><input style="border: 1px solid rgb(0, 0, 0); font-family: arial; font-size: 12px; height: 20px; width: 200px; background-color: rgb(255, 255, 255); color: rgb(0, 0, 0);" name="5" type="text"></td> </tr><tr> <td>Betreff:</td><td><select style="border: 1px solid rgb(0, 0, 0); font-family: arial; font-size: 12px; height: 20px; width: 200px; background-color: rgb(255, 255, 255); color: rgb(0, 0, 0);" name="6" id="6"><option value="Zahlung">Zahlung</option><option value="Anfrage iPhone 2g und 3G[S]">Anfrage iPhone 2g und 3G[S]</option><option value="Anfrage iPod Reparatur">Anfrage iPod Reparatur</option><option value="Sonstiges">Sonstiges</option></select></td> </tr><tr> <td>Ihre Frage:</td><td><textarea name="7" style="border: 1px solid rgb(0, 0, 0); font-family: arial; font-size: 12px; height: 60px; width: 200px; background-color: rgb(255, 255, 255); color: rgb(0, 0, 0);" cols="20" rows="5"></textarea></td> </tr><tr> </tr></tbody></table>
</div>
<div align="center">
<table cellpadding='0' cellspacing='5' border='0'>
<tr>
<td valign='top'><div align="center">Sicherheitscheck:</div></td>
<td><span style='background:#F4F4F4;border:1px dashed #333;padding:5px 10px;color:#333;'><?php echo "$code" ?></span>
<input type='text' name='captcha'>
<input type='hidden' name='captchaCheck' value='<?php echo "$code" ?>'>
<br />(Übertragen Sie den Code in das Feld) </td>
</tr>
</table>
</div>
<div align="center">
<table id="tableThree" border="0" cellpadding="0" cellspacing="5">
<tbody><tr><td colspan="2"><p>
<button type="submit">
<div align="center">Absenden</div>
</button></p></td></tr></tbody></table>
</div>
<p><input type="hidden" value="1" name="s" /></p>
</form>
<?php
} else {
$captcha = $_POST["captcha"];
$captchaCheck = $_POST["captchaCheck"];
if($captcha==""||$captcha!=$captchaCheck) {
echo "<script type='text/javascript'>
alert('Bitte beantworten Sie die Sicherheitsabfrage korrekt!');
history.back(1);
</script>";
exit;
}
$send=0;
if(mail($mail,"dean.aeli@gmail.com",$mitteilung,"from:weedit | Kontakt Formular Generator"))
{
echo "<p><strong>Ihre E-Mail wurde abgesendet.</strong></p>";
echo "<p><a href=".$_SERVER['PHP_SELF'].">Zurück zum Formular</a></p>";
}else{
echo "<p><strong>Das Formular ist leider noch nicht im Betrieb für Fragen: 0795110557!</strong></p>";
echo "<p><a href=".$_SERVER['PHP_SELF'].">Zurück zum Formular</a></p>";
mail ($mail,"dean.aeli@gmail.com",$mitteilung)
}
}
?>
Ich wäre euch sehr dankbar wenn ihr mir helfen könnt!
Besten Dank und Gruss