<div id="enquiryForm2"> <?php if (count($_POST)) { ////////// USTAWIENIA ////////// $email = 'email'; // Adres e-mail adresata $subject = 'ENQUIRY FORM FROM WEBSITE'; // Temat listu $message = 'Thank you! Yours form have been sended. If you have done it properly, we answer you very soon!'; // Komunikat $error = 'Sorry, an error occurred, please try again. '; // Komunikat błędu $charset = 'utf-8'; // Strona kodowa ////////////////////////////// $head = "MIME-Version: 1.0\r\n" . "Content-Type: text/plain; charset=$charset\r\n" . "Content-Transfer-Encoding: 8bit"; $body = ''; foreach ($_POST as $name => $value) { if (is_array($value)) { for ($i = 0; $i < count($value); $i++) { $body .= "$name=" . (get_magic_quotes_gpc() ? stripslashes($value[$i]) : $value[$i]) . "\r\n"; } } else $body .= "$name=" . (get_magic_quotes_gpc() ? stripslashes($value) : $value) . "\r\n"; } echo mail($email, "=?$charset?B?" . base64_encode($subject) . "?=", $body, $head) ? $message : $error; } else { ?> <form action="?" method="post" enctype="multipart/form-data"> <div id="enquiryFormInput1"> <input type="text" name="firstname" size="30" maxlength="30" /> </div> <div id="enquiryFormInput2"> <input type="text" name="surname" size="30" maxlength="30" /> </div> <div id="enquiryFormInput3"> <input type="text" name="home address" size="30" maxlength="60" /> </div> <div id="enquiryFormInput4"> <input type="text" name="email address" size="30" maxlength="30" /> </div> <div id="enquiryFormInput5"> <input type="text" name="prefered work" size="30" maxlength="30" /> </div> <div id="enquiryFormInput6"> <input type="file" name="cv" size="19" accept="application/msword,text/plain" /> </div> <div id="enquiryFormInput7"> <input type="image" src="images/form_40.jpg " alt="SEND" /> </div> </form> <?php } ?> </div>
problem:
samo w sobie dziala, wysyla dane z formularza na podany adres email
Problem jest taki, ze nie dodaje zalacznika. Oryginalny skrypt wysylal tylko sam text, wiec trzeba to jakos przysyosowac, ale nie ogarniam niestety.
Zamiast dodawac plik, pobiera tylko jego nazwe i wysyla na mail

Nie wiem za co sie zabrac, da sie wyslac ten plik bez upladowania go na serwer? czy pierwsza czynnosc jaka musze zrobic to uploadowac plik na serwer? Jak to zrobic?

Z gory dziekuje za kazda pomoc,
Pozdrawiam