www.streetzone.dk
jeg har prøvet denne mailfom med opload:
http://www.streetzone.dk/new.php jeg modtager et billede også teksten for billledet. Men når jeg åbner billedet, så viser den ingen ting overhovedet. Jeg kan ikke se billedet.
hvorfor.. har læst lidt på script osv.
koden:
<?php
if (isset($_POST['form'])){
if (empty($_FILES['filen']['tmp_name'])) {
$body = $_POST['body'];
}
else {
$boundary = uniqid('');
$mimeType = ($_FILES['filen']['type'] ? $_FILES['filen']['type'] :
'application/unknown');
$file = fread(fopen($_FILES['filen']['tmp_name'], 'r'),
filesize($_FILES['filen']['tmp_name']));
$file = base64_encode($file);
$file = chunk_split($file);
$body = " --$boundary ";
$body .= "Content-type: text/plain; charset=iso-8859-1 ";
$body .= "Content-transfer-encoding: 8bit ";
$body .= $_POST['body']." ";
$body .= "--$boundary ";
$body .= "Content-type: $mimeType; name=".$_FILES['filen']['name']." ";
$body .= "Content-disposition: attachment;
filename=".$_FILES['filen']['name']." ";
$body .= "Content-transfer-encoding: base64 ";
$body .= $file." ";
$body .= "--$boundary--";
$headers = "Content-type: multipart/mixed; boundary="$boundary"";
}
$minemail = "admin@streetzone.dk";
$emne = "Fil";
mail ($minemail, $emne, $body, $headers);
}
?>
<form method="post" enctype="multipart/form-data" action="<?php echo
basename($_SERVER['PHP_SELF']); ?>"> Navn: <input type="text" name="navn"><br>
Email: <input type="text" name="email"><br>
Vedlæg: <input type="file" name="filen"><br>
Besked: <textarea name="body" rows="5" cols="15"></textarea>
<input type="submit" name="form" value="Send">
</form>
--