Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP][HTML]Action="?" - formularz
ar4
post
Post #1





Grupa: Zarejestrowani
Postów: 64
Pomógł: 1
Dołączył: 10.11.2010
Skąd: Warszawa

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


Witam,
mam taki formularz:

  1. <?php
  2. $dat=date('d.m.Y');
  3. $godz=date('H:i:s');
  4.  
  5. $wyslana=not;
  6. if (count($_POST))
  7. {
  8. ////////// USTAWIENIA //////////
  9. $email = 'aaa@aaa.pl'; // Adres e-mail adresata
  10. $subject = 'Title'." " . $dat ." | " . $godz; // Temat listu
  11. $message = 'komu'; // Komunikat
  12. $error = 'error'; // Komunikat błędu
  13. $charset = 'utf-8'; // Strona kodowa
  14. //////////////////////////////
  15.  
  16. $head =
  17. "MIME-Version: 1.0\r\n" .
  18. 'From:'.$_POST['emial']."\r\n".
  19. "Content-Type: text/plain; charset=$charset\r\n" .
  20. "Content-Transfer-Encoding: 8bit";
  21. $body = '';
  22. foreach ($_POST as $name => $value)
  23. {
  24. if (is_array($value))
  25. {
  26. for ($i = 0; $i < count($value); $i++)
  27. {
  28. $body .= "$name=" . (get_magic_quotes_gpc() ? stripslashes($value[$i]) : $value[$i]) . "\r\n";
  29. }
  30. }
  31. else $body .= "$name=" . (get_magic_quotes_gpc() ? stripslashes($value) : $value) . "\r\n";
  32. }
  33. echo mail($email, "=?$charset?B?" . base64_encode($subject) . "?=", $body, $head) ? $message : $error;
  34.  
  35. $wyslana=ok;
  36. if ($wyslana==ok){header("location:https://doemna.pl");}
  37. }
  38. else
  39. {
  40. ?>
  41.  
  42. <div style="background: #fffcde; padding: 5px 5px; border: 4px dotted #AD8547; width: 640px; margin: 650px auto 50px; text-align:center;">
  43. <div class="box">
  44. <form action="?" method="post">
  45.  
  46.  
  47.  
  48. <label><span><input type="checkbox" name="zaznacz" value="0" class="ck" /></span> Tak, chcę Fakturę VAT oraz Listę Mocnych Profili.</label>
  49. <label><span>Imię:</span> <input type="text" name="imie" class="wpis" required="required" /></label>
  50. <label><span>Nazwisko:</span> <input type="text" name="nazwisko" class="wpis" required="required" /></label>
  51. <label><span>Nazwa firmy:</span> <input type="text" name="firma" class="wpis" /></label>
  52. <label><span>Ulica i nr.:</span> <input type="text" name="ulica" class="wpis" /></label>
  53. <label><span>Kod i miasto:</span> <input type="text" name="miasto" class="wpis" /></label>
  54. <label><span>NIP:</span> <input type="text" name="nip" class="wpis" /></label>
  55. <label><span>E-mail:</span> <input type="text" name="emial" class="wpis" required="required" /></label>
  56. <label><span>Dodatkowe informacje:</span><textarea name="tresc" class="wiadomosc" cols="20" rows="10"></textarea></label>
  57. <label><input type="submit" class="button" value="Wyślij!" /></label>
  58.  
  59.  
  60. </form>
  61. </div>
  62. </div>
  63. <?php
  64. }
  65. ?>


Mam problem. Dlaczego po wysłaniu formularza nie przenosi mnie na domenę określoną w: if ($wyslana==ok){header("location:https://doemna.pl");}
Po wysłaniu wiadomości przenosi mnie na domena.pl/?
Na innej domenie formularz mam na podstronie i tam wszystko działa. tutaj formularz mam na stronie głównej i już nie działa.
Czy możecie pomóc?
Go to the top of the page
+Quote Post

Posty w temacie


Closed TopicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 22.08.2025 - 10:05