Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Wysyłanie załącznika w formularzu, problem z fileopenanddecode()
motor
post
Post #1





Grupa: Zarejestrowani
Postów: 211
Pomógł: 0
Dołączył: 15.12.2005

Ostrzeżenie: (0%)
-----


Witam skorzystałem z gotowego skryptu który znalazłem na forum tzn:

http://php.webhelp.pl/index.php?id=106&roz=php&ac=read


Wyskakuje mi taki błąd
Fatal error: Call to undefined function: fileopenanddecode() in

Nie wiem co jest grane jak mogę to obejść ?

Pozdrawiam

Ten post edytował motor 2.02.2006, 18:48:30
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
lukash82
post
Post #2





Grupa: Zarejestrowani
Postów: 320
Pomógł: 2
Dołączył: 17.03.2006
Skąd: Siemianowice

Ostrzeżenie: (0%)
-----


Witam. Mam problem z wysylaniem zalacznikow za pomoca tego samego skryptu dlatego nie zaczynam nowego tematu tylko odgrzebuje ten temat. A wiec tak jak pisalem probuje uzyc tego samego skryptu. Maile dochodza jak nalezy ale niestety zalacznik nie dochodzi:/ Przychodza za to takie smieci na maila:

Odpowiedz do: test3
X-Mailer: PHP
X-Sender: test3
MIME-version: 1.0
Content-type: multipart/mixed; boundary="-->===_54654747_===<---->>4255==_"
Content-transfer-encoding: 7BIT
X-attachments: ;



---->===_54654747_===<---->>4255==_
Content-Type: text/plain; charset="us-ascii"

test3
---->===_54654747_===<---->>4255==_
Content-type: ; name="";
Content-Transfer-Encoding: base64
Content-disposition: attachment; = ""


---->===_54654747_===<---->>4255==_--

Ale to rozumiem, bo tak jest skonstrowany plik wysylajacy maila. Nie wiem jednak dlaczego nie przychodzi na maila zalacznik...? Probowalem wysylac plik tekstowy, txt i obrazek gif i nic. Nie wiem czemu to nie dziala i nie mam zbytnio pomyslu jak to rozwiazac... Jesli mozecie mi jakos pomoc albo podpowiedziec co robie zle to prosze o pomoc. Ponizej zamieszczam jeszcze raz ten skrytp do wysylania bo moze cos tam jest zle zrobione a czego nie widze:
  1. <?php
  2. $dane = $_POST['dane'];
  3. $email = $_POST['email'];
  4. $telefon = $_POST['telefon'];
  5. $miasto = $_POST['miasto'];
  6. $tresc = $_POST['tresc'];
  7.  
  8. $boundary = "-->===_54654747_===<---->>4255==_";
  9.  
  10. $head = "Od: $dane\n";
  11. $head = $head . "Odpowiedz do: $email\n";
  12. $head = $head . "X-Mailer: PHP\n";
  13. $head = $head . "X-Sender: $dane\n";
  14. $head = $head . "MIME-version: 1.0\n";
  15. $head = $head . "Content-type: multipart/mixed; ";
  16. $head = $head . "boundary=\"$boundary\"\n";
  17. $head = $head . "Content-transfer-encoding: 7BIT\n";
  18. $head = $head . "X-attachments: $filename_name;\n\n";
  19.  
  20. function fileopenanddecode($file) 
  21. {
  22.  if (is_readable($file)) 
  23. {
  24. $fd = fopen($file, "r");
  25. $plik = fread($fd, filesize($file));
  26.  $encoded = chunk_split(base64_encode($plik));
  27.  fclose($fd);
  28. }
  29. return $encoded;
  30. }
  31.  
  32. $mesg = "--" . $boundary . "\n";
  33. $mesg = $mesg . "Content-Type: text/plain; charset=\"us-ascii\"\n\n";
  34. $mesg = $mesg . $tresc . "\n";
  35. $mesg = $mesg . "--" . $boundary . "\n";
  36. $mesg = $mesg . "Content-type: " . $filename_type . "; name=\"$filename_name\";\n";
  37. $mesg = $mesg . "Content-Transfer-Encoding: base64\n";
  38. $mesg = $mesg . "Content-disposition: attachment; $filename= \"$filename_name\"\n\n";
  39. $mesg = $mesg . fileopenanddecode($filename) . "\n";
  40. $mesg = $mesg . "--" . $boundary . "-- \n";
  41.  
  42. @mail("mail@mail.pl","Wiadomosc ze strony WWW", $mesg, $head);
  43. ?>
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Aktualny czas: 11.10.2025 - 23:23