prøv denne
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"
http://www.w3.org/TR/html4/loose.dtd"><html>
<head>
<meta name="Generator" content="Stone's WebWriter 4">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="imagetoolbar" content="no">
<title>Studenterforum.dk</title>
<link href="webstyles.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#F7F0E8" leftmargin="0" topmargin="0" bottommargin="0" marginwidth="0" marginheight="0" onLoad="document.formnavn.navn.focus()">
<table width="710" align="center" cellpadding="0" cellspacing="0" style="height:100%;">
<tr>
<td width="710" height="606" colspan="3" bgcolor="#FFFFFF" style="vertical-align:top; padding-top:15px;"><table width="100%" border="0" align="center" style="height:29px;">
<tr>
<td width="40%" style="background-image:url(grafik/titel.jpg);background-repeat:no-repeat; border-right:1px dotted #999999;"> </td>
<td width="60%" style="padding-left:15px;padding-right:40px;text-align:left;"><span class="overskrift_sort">Studenterforum.dk er et websted for Spaniens- og Latinamerikainteresserede, hvor man kan læse om forskellige emner,<br>
samt få inspiration til opgaver. </span></td>
</tr>
</table>
<br>
<table width="100%" border="0" align="center" style="height:30px;">
<tr>
<td><table width="696" align="center" border="4" cellspacing="0" bordercolor="#FFFFFF" class="menu" style="height:30px;border-collapse:collapse; padding:0px; display:block;">
<tr>
<td width="18%" bgcolor="#FF950D" style="border:4px;cursor:pointer;"><a href="index.htm" class="menu"> Forside</a></td>
<td width="18%" bgcolor="#D6C482" style="border:4px;cursor:pointer;"><a href="opgaver/opgaver.php" class="menu"> Opgaver</a></td>
<td width="18%" bgcolor="#82ACD6" style="border:4px;cursor:pointer;"><a href="links.php" class="menu"> Links</a></td>
<td width="18%" bgcolor="#A2C488" style="border:4px;cursor:pointer;"><a href="formmail.php" class="menu"> Kontakt</a></td>
</tr>
</table></td>
</tr>
</table>
<table width="690" border="0" align="center" style="height:170px;vertical-align:top; padding-top:3px;">
<tr>
<td height="170"><img src="/test/grafik/forsidebillede.jpg" width="688" height="170" align="top"></td>
</tr>
</table>
<table width="690" border="0" cellpadding="0" align="center" style="background-color:#F7F3EF; height:70px; background-image:url(grafik/border.jpg); background-position:bottom; background-repeat:no-repeat;">
<tr>
<td width="210"> </td>
<td width="169"> </td>
<td width="150" align="center"> </td>
<td width="150" align="center"> </td>
</tr>
</table>
<table width="690" border="0" cellpadding="0" align="center" style="background-color:#EBDFCF; height:300px;">
<tr>
<td valign="top" style=" padding-top:20px;"><table width="670" border="0" cellpadding="0" align="center" style="height:180px; border-left:1px dotted #999999;">
<tr>
<td width="517" style="border-bottom:1px dotted #999999; height:39px;"><table width="310" border="0" align="center">
<tr>
<td class="midtertekst">Test af skrifttype og farve... kontakt </td>
</tr>
</table></td>
<td width="146" style="border-left:1px dotted #999999;border-bottom:1px dotted #999999;"> </td>
</tr>
<tr>
<td valign="top" style="padding-top:5px;"><table width="95%" height="79" border="0" align="center">
<tr>
<td><?php
// Your e-mail adress:
$mailto = "webmaster@studenterforum.dk";
# Maximum size of attachment in bytes:
$max_attach_size = 500000;
?>
<style type="text/css">
<!--
.caution { color: red; font-weight: bold; }
-->
</style>
<?php
/*if (empty($_POST['form_submitted']))
{
?>
<p>Please fill out the form:</p><?php
}
*/
if (isset($_POST["form_submitted"]))
{
$name = $_POST['name'];
$email = $_POST['email'];
$subject = $_POST['subject'];
$text = $_POST['text'];
unset($errors);
if ($email != "" and !preg_match("/^[^@]+@.+\.\D{2,5}$/", $email)) $errors[] = "Angiv venligst en gyldig e-mailadresse";
if ($text == "") $errors[] = "Indtast venligst en besked";
if ($_FILES['probe']['size'] > $max_attach_size) $errors[] = "attachment too large (".number_format($_FILES['probe']['size']/1000,0,",","")." KB) - maximum size: ".number_format($max_attach_size/1000,0,",","")." KB";
if (empty($errors))
{
$text = stripslashes($text);
$subject = stripslashes($subject);
if ($name != "") $mail_name=$name; else $mail_name="Unknown";
if ($subject != "") $mail_subject = $subject; else $mail_subject = "Fra Studenterforum - No subject";
if ($email != "") $mail_email = $email; else $mail_email = "email@unknown.xyz";
$ip = $_SERVER["REMOTE_ADDR"];
// if attachment, MIME-Mail:
if (isset($_FILES['probe']['name']) && trim($_FILES['probe']['name']) != "")
{
// read and encode file:
$datei_content = fread(fopen($_FILES['probe']['tmp_name'],"r"),filesize($_FILES['probe']['tmp_name']));
$datei_content = chunk_split(base64_encode($datei_content),76,"\n");
// Boundary:
$boundary = md5(uniqid(rand()));
// Mail-Header:
$mail_header = "From: ".$mail_name." <".$mail_email.">\n";
$mail_header .= "X-Sender-IP: ".$ip."\n";
$mail_header .= "MIME-Version: 1.0\n";
$mail_header .= "Content-Type: multipart/mixed; boundary=\"".$boundary."\"\n";
$mail_header .= "This is a multi-part message in MIME format.\n";
// Mail-Text:
$mail_header .= "--".$boundary;
$mail_header .= "\nContent-Type: text/plain";
$mail_header .= "\nContent-Transfer-Encoding: 8bit";
$mail_header .= "\n\n".$text;
// Attachment:
$mail_header .= "\n--".$boundary;
$mail_header .= "\nContent-Type: ".$_FILES['probe']['type']."; name=\"".$_FILES['probe']['name']."\"";
$mail_header .= "\nContent-Transfer-Encoding: base64";
$mail_header .= "\nContent-Disposition: attachment; filename=\"".$_FILES['probe']['name']."\"";
$mail_header .= "\n\n".$datei_content;
// End:
$mail_header .= "\n--".$boundary."--";
// Sende E-Mail und gebe Fehler bzw. Bestaetigung aus
if (@mail($mailto,$mail_subject,"",$mail_header)) $sent = true; else $errors[] = "no connection to the mailserver - please try again later";
}
// no attachment, normal E-mail:
else
{
$mail_header = "From: ".$mail_name." <".$mail_email.">\n";
$mail_header .= "X-Sender-IP: $ip\n";
$mail_header .= "Content-Type: text/plain";
if (@mail($mailto,$mail_subject,$text,$mail_header)) $sent = true; else $errors[] = "no connection to the mailserver - please try again later";
}
// copy to sender:
if (isset($sent) && isset($email) && $email != "" && isset($_POST['copy']))
{
if (isset($_FILES['probe']['name']) && trim($_FILES['probe']['name']) != "") $copy_mail_text = "Copy of the e-mail:\n\n".$text."\n\nAttachment: ".$_FILES['probe']['name']; else $copy_mail_text = "Copy of the e-mail:\n\n".$text;
$header= "From: ".$mailto."\n";
$header .= "X-Sender-IP: ".$ip."\n";
$header .= "Content-Type: text/plain";
@mail($email, $mail_subject, $copy_mail_text, $header);
}
}
}
if (empty($sent))
{
if(isset($errors))
{
?><p class="caution">Error:</p><ul><?php foreach($errors as $f) { ?><li><?php echo $f; ?></li><?php } ?></ul><br /><?php
}
?><form name="formnavn" form method="post" action="<?php echo basename($_SERVER["PHP_SELF"]); ?>" enctype="multipart/form-data"><div>
<p>Navn:<br />
<input type="text" name="navn" style="border: 1px solid #999999;" value="<?php if (isset($name)) echo htmlentities(stripslashes($name)); else echo ""; ?>" size="35" /></p>
<p>E-mail:<br /><input type="text" name="email" style="border: 1px solid #999999;" value="<?php if (isset($email)) echo htmlentities(stripslashes($email)); else echo ""; ?>" size="35" /></p>
<p>Emne:<br /><input type="text" name="subject" style="border: 1px solid #999999;" value="<?php if (isset($subject)) echo htmlentities(stripslashes($subject)); else echo ""; ?>" size="35" /></p>
Besked:<br />
<textarea name="text" cols="45" rows="8" style="border: 1px solid #999999;"><?php if (isset($text)) echo htmlentities(stripslashes($text)); else echo ""; ?>
</textarea>
<br>
<br>
Attachment:<br /><input type="file" name="probe" style="border: 1px solid #999999;cursor:pointer;" value="<?php if (isset($_POST['probe'])) echo htmlentities(stripslashes($_POST['probe'])); else echo ""; ?>" size="20"/></p>
<br />
<p><input type="submit" style="border: 1px solid #999999; cursor:pointer;" name="form_submitted" class="submit_knap" value="OK - Send" /> <input type="checkbox" name="copy" value="true" /> Send kopi til afsender</p>
</div>
<p><br /><b>Tak!</b><input value="<?php echo "$name"; ?>" disabled="disabled" readonly="readonly" name="name" style="border:0;"><br />
Beskeden er sendt, men da du ikke angav en e-mailadresse, kan vi ikke besvare din henvendelse.<br />
.</p>
</form><?php
}
else
{
if (empty($email)) { ?>
<p><br /><b>Tak!</b><input value="<?php echo "$name"; ?>" disabled="disabled" readonly="readonly" name="name" style="border:0;"><br />
Beskeden er sendt, men da du ikke angav en e-mailadresse, kan vi ikke besvare din henvendelse.<br />
.</p>
<?php }
else { ?><p><b>Tak!</b><input value="<?php echo "$name"; ?>" disabled="disabled" readonly="readonly" name="name"><br />
Beskeden er sendt.<br />
</p>
<?php }
}
// If you want to remove the Link please donate some Euros:
//
http://www.mylittlehomepage.net/donation.html?><p style="font-size: 9px; color:#999999">Script by <a class="plain" href="
http://www.mylittlehomepage.net/">Alex</a></td> </tr>
</table>
</td>
<td valign="top" style="border-left:1px dotted #999999;">
<table width="92%" border="0" align="center" style="height:15px; vertical-align:top;">
<tr>
<td valign="top" class="sidemenu" style="text-align:left;">
<br>
<img src="grafik/arrow.jpg" width="14" height="11"><a class="sidemenu" href="om.php">Om Studenterforum</a><br>
<br>
<img src="grafik/arrow.jpg" width="14" height="11"><a class="sidemenu" href="redaktion.php">Redaktionen</a><br>
<br>
<img src="grafik/arrow.jpg" width="14" height="11"><a class="sidemenu" href="#">Anbefal til en ven </a></td>
</tr>
</table>
</td>
</tr>
</table>
<br></td>
</tr>
</table></td>
</tr>
<tr>
<td height="15" colspan="3" bgcolor="#FFFFFF" style="vertical-align:top;"> </td>
</tr>
</table>
</body>
</html>