<FORM NAME="zalacznik" METHOD="post" ACTION="#" ENCTYPE="multipart/form-data">
WSTAW FOTOGRAFIĘ<br>
<INPUT type="file" name="plik1"><br>
<INPUT TYPE="SUBMIT" VALUE="Wyślij" name="ok">
</FORM>
<?php
if ($_POST["ok"])
{
srand((double)microtime()*10000000);
$znacznik = md5(uniqid(rand()));
////////// USTAWIENIA //////////
$tytul = 'Ankieta personalna'; // Temat listu
$message = 'Dziękujemy za przesłanie formularza. Informacje zostały prawidłowo dodane do naszej bazy danych.'; // Komunikat
$error = 'Wystąpił błąd podczas wysyłania formularza'; // Komunikat błędu
//////////////////////////////
// Nagłówki
$naglowki = "From: \n";
$naglowki .= "MIME-Version: 1.0\n";
$naglowki .= "Content-Type: multipart/mixed;\n";
$naglowki .= "\tboundary=\"___$znacznik==\"";
// Treść listu
$tresclistu .="Content-Type: text/plain; charset=\"iso-8859-2\"\n";
$tresclistu .="Content-Transfer-Encoding: 8bit\n";
$tresclistu .="\n";
// Załącznik
$nazwa_tymczasowa = $_FILES["plik1"]["tmp_name"];
$nazwa_pliku = $_FILES["plik1"]["name"];
if (is_uploaded_file($nazwa_tymczasowa))
{
$tresclistu .="--___$znacznik==\n";
$tresclistu .="Content-Type: image/jpg\n";
$tresclistu .="Content-Disposition: attachment;\n";
$tresclistu .=" filename=\"$nazwa_pliku\"\n";
$tresclistu .="Content-Transfer-Encoding: base64\n\n";
$f = fopen($nazwa_tymczasowa, "rb");
$dane = fread($f,filesize($nazwa_tymczasowa));
fclose($f);
$tresclistu .= chunk_split(base64_encode($dane));
}
// wysłanie listu
if (mail($odbiorca,$tytul,$tresclistu,$naglowki))
{
print "".$message."";
}
else
{
print "".$error."";
}
}
?>
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}