Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [HTML][MySQL][PHP]Wysyłka <table> w mailu
harbii
post
Post #1





Grupa: Zarejestrowani
Postów: 311
Pomógł: 1
Dołączył: 27.05.2006

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


Witam.
Pomocy brak pomysłu!

Z sqla generuje mi sie tabelka z danymi.
  1. $zapytanie = "SELECT * FROM sklep ORDER BY `id` ASC ";
  2. $wykonaj = mysql_query($zapytanie);
  3. while($dane = mysql_fetch_array($wykonaj))
  4. {
  5. $id = $dane['id'];
  6. $nazwa = $dane['nazwa'];
  7. $cena = $dane['cena'];
  8. echo '<tr><td>'.$id.'</td>..... i tak dalej
  9. }


i dosteje efekt:
  1. <table><tr><td>1</td><td>Lizak</td><td>2,5zł</td></tr><tr><td>2</td><td>czekolada</td><td>8,5zł</td></tr></table>


Jak w takiej formie wysłać to na maila? (IMG:style_emoticons/default/facepalmxd.gif)
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
b4rt3kk
post
Post #2





Grupa: Zarejestrowani
Postów: 1 933
Pomógł: 460
Dołączył: 2.04.2010
Skąd: Lublin

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


Przykład wprost z manuala...

  1. // To send HTML mail, the Content-type header must be set
  2. $headers = 'MIME-Version: 1.0' . "\r\n";
  3. $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
  4.  
  5. // Additional headers
  6. $headers .= 'To: Mary <mary@example.com>, Kelly <kelly@example.com>' . "\r\n";
  7. $headers .= 'From: Birthday Reminder <birthday@example.com>' . "\r\n";
  8. $headers .= 'Cc: birthdayarchive@example.com' . "\r\n";
  9. $headers .= 'Bcc: birthdaycheck@example.com' . "\r\n";
  10.  
  11. // Mail it
  12. mail($to, $subject, $message, $headers);
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: 14.10.2025 - 01:21