Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [PHP]Skrypt
Forum PHP.pl > Forum > Przedszkole
Ukasiuuu
Mam takie pytanie do specjalistów w tym temacie, a mianowicie czy poniższy skrypt do wysyłania wiadomości e-mail ze strony wymaga bazy MySQL na serwerze na którym jest umieszczona strona questionmark.gif Jeśli tak to bardzo proszę o podanie jaki inny skrypt mógł by zastąpić ten podany by na serwerze nie musiało być bazy MySQL gdyż serwer na którym jest strona nie ma bazy MySQL.

  1. [/php]
  2.  
  3. <?php
  4.  
  5. $add_site = true;
  6.  
  7. ?>
  8.  
  9. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  10.  
  11. <html>
  12.  
  13. <head>
  14.  
  15. <meta name="generator" content="WebSite PRO 4.3" />
  16.  
  17. <meta http-equiv="Content-type" content="text/html; charset=windows-1250" />
  18.  
  19. <meta name="Author" content="Radosław Zygadło" />
  20.  
  21. <meta name="Description" content="" />
  22.  
  23. <meta name="Keywords" content="" />
  24.  
  25. <link rel="stylesheet" type="text/css" href="css/main.css">
  26.  
  27. <link rel="stylesheet" type="text/css" href="css/lightbox.css" media="screen" />
  28.  
  29. <link rel="shortcut icon" href="images/favicon.ico">
  30.  
  31. <title>ART-FLEX_pl - Koszulki dla Ciebie i Twojej firmy.</title>
  32.  
  33.  
  34.  
  35. <script src="js/prototype.js" type="text/javascript"></script>
  36.  
  37. <script src="js/scriptaculous.js?load=effects,builder" type="text/javascript"></script>
  38.  
  39. <script src="js/lightbox.js" type="text/javascript"></script>
  40.  
  41.  
  42.  
  43. </head>
  44.  
  45. <body>
  46.  
  47. <table align="center" valign="top" width="921" border="0" cellspacing="0" cellpadding="0">
  48.  
  49. <tr>
  50.  
  51. <td><?php include "include/naglowek.php"; ?></td>
  52.  
  53. </tr>
  54.  
  55. <tr>
  56.  
  57. <td align="center" width="921" background="images/main.gif">
  58.  
  59. <table border="0" cellspacing="0" cellpadding="0">
  60.  
  61. <tr>
  62.  
  63. <td rowspan="2" width="40"></td>
  64.  
  65. <td rowspan="2" width="312" height="312"><a href="images/jpg/mapa.jpg" rel="lightbox" title="ART-FLEX, ul. Narutowicza 3, 33-100 Tarnów"><img src="images/mapa.gif" border="0" width="312" height="312" alt=""></a></td>
  66.  
  67. <td width="519" height="50" class="styl2" valign="middle">
  68.  
  69. Napisz do nas<br>
  70.  
  71. </td>
  72.  
  73. <td rowspan="2" width="50"></td>
  74.  
  75. </tr>
  76.  
  77. <tr>
  78.  
  79. <td width="519" class="styl1" valign="top">
  80.  
  81. <?php
  82.  
  83.  
  84.  
  85. if (count($_POST))
  86.  
  87. {
  88.  
  89.  
  90.  
  91. $email = 'biuro@art-flex.pl';
  92.  
  93. $subject = 'Mail wysłany przez strone';
  94.  
  95. $message = '<table width="500" height="200" border="0" cellspacing="0" cellpadding="0"><tr><td class="styl2" align="center">Diękujemy za wiadomość<br>postaramy się wkrótce odpowiedzieć</td></tr></table>';
  96.  
  97. $error = '<table width="500" height="200" border="0" cellspacing="0" cellpadding="0"><tr><td class="styl2" align="center">Wystąpił błąd podczas wysyłania formularza</td></tr></table>';
  98.  
  99. $charset = 'windows-1250';
  100.  
  101.  
  102.  
  103.  
  104.  
  105. $head =
  106.  
  107. "MIME-Version: 1.0\r\n" .
  108.  
  109. "Content-Type: text/plain; charset=$charset\r\n" .
  110.  
  111. "Content-Transfer-Encoding: 8bit";
  112.  
  113. $body = '';
  114.  
  115. foreach ($_POST as $name => $value)
  116.  
  117. {
  118.  
  119. if (is_array($value))
  120.  
  121. {
  122.  
  123. for ($i = 0; $i < count($value); $i++)
  124.  
  125. {
  126.  
  127. $body .= "$name=" . (get_magic_quotes_gpc() ? stripslashes($value[$i]) : $value[$i]) . "\r\n";
  128.  
  129. }
  130.  
  131. }
  132.  
  133. else $body .= "$name=" . (get_magic_quotes_gpc() ? stripslashes($value) : $value) . "\r\n";
  134.  
  135. }
  136.  
  137. echo mail($email, "=?$charset?B?" . base64_encode($subject) . "?=", $body, $head) ? $message : $error;
  138.  
  139. }
  140.  
  141. else
  142.  
  143. {
  144.  
  145. ?>
  146.  
  147. <form action="?" method="post">
  148.  
  149. <table width="519" border="0" cellspacing="0" cellpadding="0">
  150.  
  151. <tr>
  152.  
  153. <td class="main" align="center">
  154.  
  155. <table align="center" valign="top" width="519" border="0" cellspacing="0" cellpadding="0">
  156.  
  157. <tr>
  158.  
  159. <td valign="top">
  160.  
  161. <table valign="top" width="150" border="0" cellspacing="0" cellpadding="0">
  162.  
  163. <tr>
  164.  
  165. <td class="styl5">* imie (nick)</td>
  166.  
  167. </tr>
  168.  
  169. <tr>
  170.  
  171. <td><input type="text" name="Imie_i_nazwisko"></td>
  172.  
  173. </tr>
  174.  
  175. <tr>
  176.  
  177. <td class="styl5">nazwisko</td>
  178.  
  179. </tr>
  180.  
  181. <tr>
  182.  
  183. <td><input type="text" name="Imie_i_nazwisko"></td>
  184.  
  185. </tr>
  186.  
  187. <tr>
  188.  
  189. <td class="styl5">firma</td>
  190.  
  191. </tr>
  192.  
  193. <tr>
  194.  
  195. <td><input type="text" name="Firma"></td>
  196.  
  197. </tr>
  198.  
  199. <tr>
  200.  
  201. <td class="styl5">* e-mail</td>
  202.  
  203. </tr>
  204.  
  205. <tr>
  206.  
  207. <td><input type="text" name="E-Mail"></td>
  208.  
  209. </tr>
  210.  
  211. <tr>
  212.  
  213. <td class="styl5">telefon</td>
  214.  
  215. </tr>
  216.  
  217. <tr>
  218.  
  219. <td><input type="text" name="Telefon"></td>
  220.  
  221. </tr>
  222.  
  223. </table>
  224.  
  225. </td>
  226.  
  227. <td width="10"></td>
  228.  
  229. <td valign="top">
  230.  
  231. <table valign="top" width="250" border="0" cellspacing="0" cellpadding="0">
  232.  
  233. <tr>
  234.  
  235. <td class="styl5">* treść</td>
  236.  
  237. </tr>
  238.  
  239. <tr>
  240.  
  241. <td><textarea name="Komentarz" rows="8" cols="40"></textarea></td>
  242.  
  243. </tr>
  244.  
  245. <tr>
  246.  
  247. <td class="styl5">* tak oznaczone pola musisz wypełnić</td>
  248.  
  249. </tr>
  250.  
  251. <tr>
  252.  
  253. <td><input type="submit" value="Wyślij"><input type="reset" value="Skasuj"></td>
  254.  
  255. </tr>
  256.  
  257. </table>
  258.  
  259. </td>
  260.  
  261. </tr>
  262.  
  263. </table>
  264.  
  265. </td>
  266.  
  267. </tr>
  268.  
  269. </table>
  270.  
  271. </form>
  272.  
  273. <?php
  274.  
  275. }
  276.  
  277. ?>
  278.  
  279. </td>
  280.  
  281. </tr>
  282.  
  283. </table>
  284.  
  285. </td>
  286.  
  287. </tr>
  288.  
  289. <tr>
  290.  
  291. <td><?php include "include/stopka.php"; ?></td>
  292.  
  293. </tr>
  294.  
  295. </table>
  296.  
  297.  
  298.  
  299. </body>
  300.  
  301. </html>
  302. [php]

tehaha
nie, nie wymaga bazy
Redox
Prześledź ten kod dokładnie i pomyśł do czego miałaby być tutaj potrzebna baza danych?
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.