Jump to content
Sign in to follow this  
Stref

Feil ved mailscript

Recommended Posts

Hei!

 

Når en person ikke fyller ut et felt her trodde jeg meningen var å få en feilmelding tilbake. Det skjer ikke. Hvorfor?

 

Scriptet er:

 

<html>

<head>

<title>

Mail meg

</title>

</head>

 

<body>

<h2 align="center"><u>Mail Status</u></h2>

<?php

 

$epost = "min mail"; // Din epost

$tema = "Mail fra prosjektsida"; //Subject

 

$fra = "FROM: $sender";

$melding = "Fra: $navn\n";

$melding .= "$hilsen\n";

 

if ($navn == "" || $epost == "" || $hilsen == "")

{

echo "<h2>Feil!</h2>";

echo "<p>Eposten kan ikke sendes fordi du ikke har fylt inn de nødvendige feltene.</p>";

echo "<p><a href=\"javascript:history.back(1)\">Tilbake</a></p>";

}

if(mail($epost, $tema, $melding, $fra)) {

echo "<p>Mailen er sent. Webmaster vil snart få beskjeden din.Takk!</p>";

}else{

echo "<h2>Feil! Det oppsto feil under sending av mailen</h2>";

echo "<p>Vennligst prøv på nytt.</p>";

echo "<p><a href=\"javascript:history.back(1)\">Tilbake</a></p>";

echo "<p>Hvis problemet fortsetter trykk <a href=\"mailto:min mail\">her</a>"; //din mail adr

}

 

?>

 

 

</body>

</html>

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...