Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP] formularz sam wysyła maila :O
fakenmr
post
Post #1





Grupa: Zarejestrowani
Postów: 26
Pomógł: 0
Dołączył: 23.09.2011

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


(IMG:style_emoticons/default/oneeyedsmiley02.png) Witam mam taki problem :

A mianowicie jestem sobie na swojej stronie zrobiłem formularz dodałem kod żeby ten dane z formularza trafiały do bazy danych no jest ok trafiać trafiają ale jest małe ale

mam 3 zakładki Strona główna Kontakt(ten formularz właśnie) i Logowanie Admina

i po kliknięciu na Kontakt automatycznie wysyła mi pusty zbiór mam pytanie czemu tak się dzieje może ktoś pomoże mi to rozwiązać Poniżej zamieszczam swój kodzik (IMG:style_emoticons/default/smile.gif)


  1. <?php
  2. include ('config.php');
  3.  
  4. //dodawanie według typu
  5. if($_GET['typ'])
  6. {
  7. //list polecon dodawanie
  8. if($_GET['typ']=='list_polecony')
  9. {
  10. //dodanie
  11. if($_POST['refresh'] and $_POST['refresh']!=$_SESSION['refresh'])
  12. {
  13. $_SESSION['refresh']=$_POST['refresh'] ;
  14. $date = $_POST['data_nadania']." ".$_POST['data_nadania_g'].":".$_POST['data_nadania_m'];
  15. $data_nadania=strtotime($date);
  16.  
  17. if(mysql_query("INSERT INTO `reklamacja` (`nr_nadania` ,`imie_rekl` ,`nazwisko_rekl` ,`ulica_rekl` ,`kod_poczt_rekl` ,`miasto_rekl` ,`mail`, `tel_rekl` , `temat` ,`tresc`)VALUES ( '".$_POST['nr_nadania']."', '".$_POST['imie_rekl']."', '".$_POST['nazwisko_rekl']."', '".$_POST['ulica_rekl']."', '".$_POST['kod_poczt_rekl']."', '".$_POST['miasto_rekl']."', '".$_POST['mail']."', '".$_POST['telefon']."', '" .$_POST['tresc']."','".$_POST['temat']."');"))
  18. {
  19. Echo "<font color='green'>Wysłano Pomyślnie Wiadomość</font>";
  20. }
  21. else
  22. {
  23. Echo "<font color='red'>Nie udało się wysłać wiadomości - prawdopodobnie zrobiłeś/-aś jakiś mały błąd</font>";
  24. }
  25. ?>



I Formularz
  1. <form action="" method="POST" style="margin-top:10px;" >
  2. <table width="493" id="tbl_insert">
  3. <tr></tr>
  4. <tr>
  5. <th width="149" scope="col"> </th>
  6. <th width="250" scope="col">Proszę wypenić wszystkie pola</th>
  7. </tr>
  8. <tr>
  9. <th scope="row">Numer nadania</th>
  10. <td><input type="text" name="nr_nadania" id="nr_nadania"></td>
  11.  
  12.  
  13. </tr>
  14. <tr>
  15. <th scope="row">Imię </th>
  16. <td><input type="text" name="imie_rekl" id="imie_rekl"></td>
  17.  
  18. </tr>
  19. <tr>
  20. <th scope="row">Nazwisko</th>
  21. <td><input type="text" name="nazwisko_rekl" id="nazwisko_rekl"></td>
  22.  
  23. </tr>
  24. <tr>
  25. <th scope="row">Ulica</th>
  26. <td><input type="text" name="ulica_rekl" id="ulica_rekl"></td>
  27.  
  28. </tr>
  29. <tr>
  30. <th scope="row">Kod Pocztowy</th>
  31. <td><input type="text" name="kod_poczt_rekl" id="kod_poczt_rekl"></td>
  32.  
  33. </tr>
  34. <tr>
  35. <th scope="row">Miasto</th>
  36. <td><input type="text" name="miasto_rekl" id="miasto_rekl"></td>
  37.  
  38. </tr>
  39. <tr>
  40. <th scope="row">E-mail</th>
  41. <td><input type="text" name="mail" id="mail"></td>
  42.  
  43. </tr>
  44. <tr>
  45. <th scope="row">Telefon</th>
  46. <td><input type="text" name="tel_rekl" id="tel_rekl"></td>
  47.  
  48. </tr>
  49. <tr>
  50.  
  51.  
  52. </tr>
  53. <tr>
  54. <th scope="row">Godzina</th>
  55. <td><input size="2" maxlength="2" name="data_nadania_g" type="text" value="<?=date("H");?>"/>
  56. minuta
  57. <input size="2" maxlength="2" name="data_nadania_m" type="text" value="<?=date("i");?>"/></td>
  58. </tr>
  59. <tr>
  60. <tr>
  61. <th scope="row">Temat</th>
  62. <td><select name="temat" id="temat">
  63. asdasdasd
  64. </select></td>
  65.  
  66. </tr>
  67. <tr>
  68. <th scope="row">Treść</th>
  69. <td><textarea name="tresc" id="tresc"></textarea></td>
  70.  
  71. </tr>
  72. <tr>
  73. <th scope="row"> </th>
  74.  
  75. <td><input name="btn" type="image" src="images/menu/wyslij.png" id="btn" style="width: 100px;float:right;" value="Wyślij" /></td>
  76. </tr>
  77. </table>
  78. <input type="hidden" name="MM_insert" value="form">
  79. </form>


Ten post edytował fakenmr 18.04.2012, 12:07:02
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: 23.08.2025 - 18:32