Gabriel Kumar
Neues Mitglied
Hi,
ich habe für meine Website ein Kontaktformular programmiert. Wenn ich meine index.php Datei hochlade, kommt nur ein HTTP 500-Fehler. Was mache ich falsch? Wenn ich die Website ohne das PHP, also nur mit dem HTML-Kontaktformular als index.html hochlade, wird alles angezeigt. Mein PHP und HTML ist in einer PHP Datei. Ich hoffe ihr könnt mir weiterhelfen
Das Kontaktformular-HTML aus index.php
Das PHP aus index.php
ich habe für meine Website ein Kontaktformular programmiert. Wenn ich meine index.php Datei hochlade, kommt nur ein HTTP 500-Fehler. Was mache ich falsch? Wenn ich die Website ohne das PHP, also nur mit dem HTML-Kontaktformular als index.html hochlade, wird alles angezeigt. Mein PHP und HTML ist in einer PHP Datei. Ich hoffe ihr könnt mir weiterhelfen
Das Kontaktformular-HTML aus index.php
HTML:
<section id="kontakt">
<h3>Kontakt</h3>
<hr>
<form method="post">
<input type="email" name="email" tabindex="1" placeholder="E-Mail"><br> <!--Email--->
<input type="text" name="betreff" tabindex="2" placeholder="Betreff"><br> <!--Betreff--->
<textarea name="msg" tabindex="3" placeholder="Nachricht"></textarea><br> <!--Nachricht--->
<input class="button" type="submit">
</form>
</section>
Das PHP aus index.php
PHP:
<?php
//KONFIGURATION
$mailTo = '[email protected]';
$mailFrom = '"No-reply" <[email protected]>';
$mailSubject = 'Kontaktanfrage über gabriel-kumar.de';
$returnPage = 'gesendet.php';
$returnErrorPage = 'error.php';
$mailText = 'Über das Kontaktformular ist eine Nachricht eingegangen: \n \n-------------------------------------------------\n \n';
// Mail Erstellen
if(isset($_POST['submit'])) {
foreach($_POST as $name => $value) {
if(is_array($value)) {
$mailText = .= $name . ":\n";
foreach($valueArray as $entry) {
$mailText .= " " . $value . "\n";
}
}else{
$mailText .= $name . ": " . $value . "\n"."\n";
}
}
}
// Mail Senden
$mailSent = @mail($mailTo, $mailSubject, $mailText, "From : ".$mailFrom);
// Return Seite
if($mailSent == TRUE) {
header("Location:" . $returnPage);
}else{
header("Location:" . $returnErrorPage);
}
exit()
?>