Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Formularz z załącznikiem, Pomoc w modyikacji skryptu
ppsi
post 16.07.2005, 23:21:52
Post #1





Grupa: Zarejestrowani
Postów: 48
Pomógł: 0
Dołączył: 16.07.2005

Ostrzeżenie: (10%)
X----


Witam .Szukam pomocy w przerobieniu skryptu. Programik działa wysyła na adres e-mail jakas tam wiadomość z załacznikiem (jakmś plikiem) Niestety wiem tylko jak zrobić aby wysyłał tylko jeden plik a potrzebuje ,żeby wysyłał 3 do 4 plików. Czy ktoś pomoże mi przerobić poniższy skryp? Prosze bardzo o pomoc . Z góry dziekuje

OTO KOD HTML FORMULARZA
  1. <form name="formularz" method="post" action="mail.php" enctype="multipart/form-data">
  2. <INPUT TYPE="hidden" NAME="brak" VALUE="pole nie zostało wypełnione">
  3. <INPUT TYPE="text" NAME="imie" SIZE="20" <br>
  4. <br>
  5. <INPUT TYPE="text" NAME="nazwisko" SIZE="20" <br>
  6. <br>
  7. <INPUT TYPE="text" NAME="adres" SIZE="20" <br>
  8. <br>
  9. <INPUT TYPE="text" NAME="telefon" SIZE="20" <br>
  10. <br>
  11. <INPUT TYPE="text" NAME="email" SIZE="20" <br>
  12. <br>
  13. <form method="post" action="mail.php" enctype="multipart/form-data">
  14. <input type="file" name="filename">
  15. <br>
  16. <input type="submit" name="WYSLIJ" value="Submit">
  17. </form>


OTO KOD php


  1. <?php
  2.  
  3. $boundary = &#092;"-->===_54654747_===<---->>4255==_\"; 
  4.  
  5. $head = &#092;"From: ProPsi@com.pln\"; 
  6. $head = $head . &#092;"Reply-To: $emailn\"; 
  7. $head = $head . &#092;"X-Mailer: phpn\"; 
  8. $head = $head . &#092;"X-Sender: ProPsi@com.pln\"; 
  9. $head = $head . &#092;"MIME-version: 1.0n\"; 
  10. $head = $head . &#092;"Content-type: multipart/mixed; \"; 
  11. $head = $head . &#092;"boundary=\"$boundary\"n\"; 
  12. $head = $head . &#092;"Content-transfer-encoding: 7BITn\"; 
  13. $head = $head . &#092;"X-attachments: $filename_name;nn\"; 
  14.  
  15.  
  16.  
  17. $mesg = &#092;"--\" . $boundary . \"n\";
  18. $mesg = $mesg . &#092;"Content-Type: text/plain; charset=\"us-ascii\"nn\"; 
  19. $mesg = $mesg 
  20. .$imie = &#092;"IMIE: $imie\" .\"n\" 
  21. .$nazwisko = &#092;"NAZWISKO: $nazwisko\" .\"n\"
  22. .$adres = &#092;"ADRES: $adres\" .\"n\"
  23. .$telefon = &#092;"NR TELEFONU: $telefon\" .\"n\"
  24. .$email = &#092;"E-MAIL: $email\" .\"n\"; 
  25. $mesg = $mesg . &#092;"--\" . $boundary . \"n\";
  26. $mesg = $mesg . &#092;"Content-type: \" . $filename_type . \"; name=\"$filename_name\";n\";  
  27. $mesg = $mesg . &#092;"Content-Transfer-Encoding: base64n\"; 
  28. $mesg = $mesg . &#092;"Content-disposition: attachment; filename= \"$filename_name\"nn\"; 
  29. $mesg = $mesg . fileopenanddecode($filename) . &#092;"n\";  
  30. $mesg = $mesg . &#092;"--\" . $boundary . \"-- n\"; 
  31.  
  32.  
  33.  
  34. function fileopenanddecode($file) { 
  35. if (is_readable($file)) { 
  36.  $fd = fopen($file, &#092;"r\"); 
  37.  $plik = fread($fd, filesize($file)); 
  38.  $encoded = chunk_split(base64_encode($plik)); 
  39.  fclose($fd);  
  40. } 
  41. return $encoded; 
  42. } 
  43.  
  44.  
  45.  
  46. mail(&#092;"kaczor4@o2.pl\", \"ProPsi\", $mesg , $head);
  47.  
  48.  
  49. ?>


---
nospor


Ten post edytował nospor 28.07.2005, 08:03:53
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 18.07.2025 - 02:02