Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php] Formularz Kontaktowy...
kkuubbaa88
post
Post #1





Grupa: Zarejestrowani
Postów: 510
Pomógł: 1
Dołączył: 27.08.2007

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


mam sobie formularz:

  1. <?php
  2. if (empty($_POST['submit'])) {
  3.  
  4. echo "<table border=\"0\"><form method=\"post\">
  5. <tr>
  6. ...
  7. ?>


jest i przycisk

  1. <?php
  2. <input type= "submit\" name=\"submit\" value=\"Wyślij\">
  3. ?>


i chcialbym zamienic to sobie na przycisk graficzny... wymacilem kod, ale nie chce dzialac... dlaczego ?

  1. <?php
  2. <input type= "image\" name=\"submit\" src=\"sonda/2.jpg\" onclick=\"submit\">
  3. ?>


po type jest znak \ ale nie chce sie tam wyswietlic (IMG:http://forum.php.pl/style_emoticons/default/tongue.gif)
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
Sadu2
post
Post #2





Grupa: Zarejestrowani
Postów: 229
Pomógł: 13
Dołączył: 31.05.2007

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


Czy może o to Ci chodziło?

http://tafclan.com/test.php

  1. <?php
  2. <input type=&#092;"submit\" name=\"submit\" style=\"background-image: url('submit.gif'); width: 78px; height: 28px; border:0px solid;\" value=\"\"/>
  3. ?>


Tam musisz wprowadzić szerokość i wysokość obrazka. Pole value zostaw puste.


Całość:

  1. <?php
  2. if (empty($_POST['submit'])) {
  3.  
  4. echo "<table border=\"0\"><form method=\"post\" action=\"kontakt.php\">
  5. <tr height=\"50\"><td></td></tr>
  6. <tr><td></td>
  7. <td></td>";
  8.  
  9. echo "<td><b>Treść Wiadomości: </b></td>
  10. <td></td>
  11. <td></td>
  12. </tr><tr>
  13. <td></td>";
  14.  
  15. echo "<td></td><td colspan=\"2\"><textarea name=\"tresc\" style=\"width: 434px; height: 150px; border-style: double; border-color: #6eb4d8; border-top-width: 1px ; border-left-width: 1px; border-bottom-width: 1px; border-right-width: 1px; overflow:hidden\" wrap=\"virtual\"></textarea>";
  16.  
  17. echo "</td><td>
  18. </td></tr><tr><td></td>
  19. <td style=\"text-align: right\"><b>Imię: </b></td><td><input type=\"text\" name=\"imie\" style=\"width: 150px; border-style: double; border-color: #6eb4d8; border-top-width: 1px ; border-left-width: 1px; border-bottom-width: 1px; border-right-width: 1px\"></td><td style=\"text-align: right\"><input type=\"text\" name=\"email\" style=\"width: 150px; border-style: double; border-color: #6eb4d8; border-top-width: 1px ; border-left-width: 1px; border-bottom-width: 1px; border-right-width: 1px\"></td><td><b> :Mail</b></td>";
  20.  
  21. echo "</tr><tr height=\"15\"><td width=\"16\"></td><td></td><td></td><td></td><td></td></tr><tr><td> </td><td></td>";
  22.  
  23. echo "<td><input type=\"submit\" name=\"submit\" style=\"background-image: url('submit.gif'); width: 78px; height: 28px; border:0px solid;\" value=\"\"/></td><td style=\"text-align: right\"><input type = \"reset\" value=\"Wyczysc\"></td><td></td></form></tr></table>";
  24. }
  25.  
  26. elseif (!empty($_POST['tresc']) && !empty($_POST['imie']) && !empty($_POST['email'])) {
  27.  
  28. if (eregi("^[[:alnum:]][a-z0-9_.-]*@[a-z0-9.-]+.[a-z]{2,4}$", stripslashes($_POST['email']))){
  29.  
  30.  
  31. $message = "Treść:\n$_POST[tresc]\n\n\nWysłał: $_POST[imie]";
  32.  
  33. $header = "From: $_POST[email] ";
  34.  
  35. @mail("adres","tytul","$message","$header")
  36. or die('Błąd - Spróbuj Ponownie');
  37.  
  38. echo "<span style=\"color: #FF0000; text-align: center;\">Wiadomosc zostala wyslana</span>";
  39. } else {
  40. echo "<span style=\"color: #FF0000; text-align: center;\"></span>";
  41.  
  42. echo "<table border=\"0\"><form method=\"post\"><tr height=\"50\"><td></td><td colspan=\"4\" style=\"text-align: center\"><span style=\"color: #FF0000; text-align: center;\"><b>Adres e-mail nie jest poprawny</b></span></td></tr>";
  43.  
  44. echo "<tr><td></td><td></td><td><b>Treść Wiadomości: </b></td><td></td><td></td></tr><tr><td></td><td></td><td colspan=\"2\"><textarea name=\"tresc\" style=\"width: 434px; height: 150px; border-style: double; border-color: #6eb4d8; border-top-width: 1px ; border-left-width: 1px; border-bottom-width: 1px; border-right-width: 1px; overflow:hidden\" wrap=\"virtual\"></textarea></td><td></td>";
  45.  
  46. echo "</tr><tr><td></td><td style=\"text-align: right\"><b>Imię: </b></td><td><input type=\"text\" name=\"imie\" style=\"width: 150px; border-style: double; border-color: #6eb4d8; border-top-width: 1px ; border-left-width: 1px; border-bottom-width: 1px; border-right-width: 1px\"></td><td style=\"text-align: right\"><input type=\"text\" name=\"email\" style=\"width: 150px; border-style: double; border-color: #6eb4d8; border-top-width: 1px ; border-left-width: 1px; border-bottom-width: 1px; border-right-width: 1px\"></td><td><b> :Mail</b></td></tr>";
  47.  
  48. echo "<tr height=\"15\"><td width=\"16\"></td><td></td><td></td><td></td><td></td></tr><tr><td> </td><td></td><td><input type= \"submit\" name=\"submit\" value=\"Wyślij\"></td><td style=\"text-align: right\"><input type= \"reset\" value=\"Wyczysc\"></td><td></td></form></tr></table>";
  49. }
  50.  
  51. } else {
  52.  
  53. echo "<table border=\"0\"><form method=\"post\">
  54. <tr height=\"50\"><td></td><td colspan=\"4\" style=\"text-align: center\"><span style=\"color: #FF0000; text-align: center;\"><b>Wszystkie pola są obowiązkowe</b></span></td></tr>";
  55.  
  56. echo "<tr><td></td><td></td><td><b>Treść Wiadomości: </b></td><td></td><td></td></tr><tr><td></td><td></td><td colspan=\"2\"><textarea name=\"tresc\" style=\"width: 434px; height: 150px; border-style: double; border-color: #6eb4d8; border-top-width: 1px ; border-left-width: 1px; border-bottom-width: 1px; border-right-width: 1px; overflow:hidden\" wrap=\"virtual\"></textarea></td><td></td></tr>";
  57.  
  58. echo "<tr><td></td><td style=\"text-align: right\"><b>Imię: </b></td><td><input type=\"text\" name=\"imie\" style=\"width: 150px; border-style: double; border-color: #6eb4d8; border-top-width: 1px ; border-left-width: 1px; border-bottom-width: 1px; border-right-width: 1px\"></td><td style=\"text-align: right\"><input type=\"text\" name=\"email\" style=\"width: 150px; border-style: double; border-color: #6eb4d8; border-top-width: 1px ; border-left-width: 1px; border-bottom-width: 1px; border-right-width: 1px\"></td><td><b> :Mail</b></td></tr>";
  59.  
  60. echo "<tr height=\"15\"><td width=\"16\"></td><td></td><td></td><td></td><td></td></tr><tr><td> </td><td></td><td><input type= \"submit\" name=\"submit\" value=\"Wyślij\"></td><td style=\"text-align: right\"><input type= \"reset\" value=\"Wyczysc\"></td><td></td></form></tr></table>";
  61. }
  62. ?>


Ten post edytował Sadu2 20.11.2007, 12:15:17
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: 8.10.2025 - 05:23