fejl i linie 19 $message = "Hej!
kontaktformular på www.fenesu.dk har jeg kombineret med filenmail.php
----
<?php
/* Set e-mail modtager */
$modtager = "info@fenesu.dk";
/* Check alle formular inputs ved check_input function */
$navn = check_input($_POST['navn'], "Skriv dit navn");
$email = check_input($_POST['email']);
$tlf = check_input($_POST['tlf']);
$besked = check_input($_POST['besked'], "Skriv en besked");
/* If e-mail is not valid show error message */
if (!preg_match("/([\w\-]+\@[\w\-]+\.[\w\-]+)/", $email))
{
show_error("E-mailadressen duer ikke ");
}
/* Let's prepare the message for the e-mail */
$emne = "kontaktformular fra fenesu.dk"
$message = "Hej!
Formularen er sendt af:
Navn: $navn
E-mail: $email
Telefon: $tlf
Besked:
$besked
End of message
";
/* Send the message using mail() function */
mail($modtager, $emne, $message);
/* Redirect visitor to the thank you page */
header('Location: tak.htm');
exit();
/* Functions we used */
function check_input($data, $problem='')
{
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
if ($problem && strlen($data) == 0)
{
show_error($problem);
}
return $data;
}
function show_error($myError)
{
?>
<html>
<body>
<b>Ret venligst følgende fejl:</b><br />
<?php echo $myError; ?>
</body>
</html>
<?php
exit();
}
?>
Er der nogen, der kan se, hvad jeg gør forkert?
v.h.
Grethe
