Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP] Cannot modify header information - headers already sent
Maker5
post
Post #1





Grupa: Zarejestrowani
Postów: 139
Pomógł: 0
Dołączył: 2.04.2008

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


Warning: Cannot modify header information - headers already sent by (output started at /zapytanie/configuration.php:14) in /zapytanie/formprocess.php on line 63

wczesniej nie bylo tego problemu a wczoraj pojawil się taki blad blad i juz naprawde nie wiem co zrobic aby jakos temu zaradzic
co proponujecie ?

link do formularza

http://alveus1.home.pl/zapytanie/index.php


i druga sprawa:
jak ktoś nie wpisze np imienia to pojawiają się dziwne znaki zamiast komunikatu:

  1. Podałeś nieprawidłowe imię. <br />Kliknij <a title="wstecz" href="java script:history.go(-1)">wstecz</a> i popraw ten błąd.';
  2.  
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
Maker5
post
Post #2





Grupa: Zarejestrowani
Postów: 139
Pomógł: 0
Dołączył: 2.04.2008

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


Cytat(O$iek @ 18.10.2010, 16:50:46 ) *
Nie żebym wątpił w swoje umiejętności jasnowidza, ale może dałbyś kod pliku formprocess.php ?
Masz tu taki mały gratis bez patrzenia w kod:
http://phpedia.pl/wiki/Cannot_add_header_i...rs_already_sent


już to czytałem i to nie pomaga (IMG:style_emoticons/default/sad.gif)

  1. <?php
  2. require_once './ValidateClass.php';
  3. require_once './configuration.php';
  4.  
  5. if(isset($_POST['send']))
  6. {
  7. if(false==ValidateClass::checkLogin(ucfirst($_POST['name'])) || empty($_POST['name']))
  8. {
  9. $error.='Podałeś nieprawidłowe imię. <br />Kliknij <a title="wstecz" href="java script:history.go(-1)">wstecz</a> i popraw ten błąd.';
  10. $error.="<br />";
  11. }
  12. if(false==ValidateClass::checkLogin(ucfirst($_POST['surname'])) || empty($_POST['surname']))
  13. {
  14. $error.='Podałeś nieprawidłowe nazwisko. <br />Kliknij <a title="wstecz" href="java script:history.go(-1)">wstecz</a> i popraw ten błąd.';
  15. $error.="<br />";
  16. }
  17. if(!is_numeric($_POST['phone_number']) || empty($_POST['phone_number']))
  18. {
  19. $error.='Podałeś zły numer telefonu (podaj tylko cyfry bez myślników i spacji). <br />Kliknij <a title="wstecz" href="java script:history.go(-1)">wstecz</a> i popraw ten błąd.';
  20. $error.="<br />";
  21. }
  22. if(false==ValidateClass::checkMail($_POST['mail']))
  23. {
  24. $error.='Podałeś nieprawidłowy adres email. <br />Kliknij <a title="wstecz" href="java script:history.go(-1)">wstecz</a> i popraw ten błąd.';
  25. $error.="<br />";
  26. }
  27. if(!empty($error))
  28. {
  29.  
  30. $error=urlencode($error);
  31. $url='Location:' . $adres . '?error=' . $error;
  32. header($url);
  33. }
  34. else
  35. {
  36. if(!empty($_POST['sugestion']))
  37. {
  38. $sugest='<br />' . 'Treść Zapytania:<br />'. htmlspecialchars($_POST['sugestion']);
  39. }
  40. //Dane klienta
  41.  
  42. $client= '' . $_POST['name'] .' '. $_POST['surname'] . '<br />Firma: ' . $_POST['street'] . ' ' . $_POST['number_flat']
  43. . '' . $_POST['postal_code'] .' ' . $_POST['town'] . '<br />Telefon: ' . $_POST['phone_number'] .
  44. $mail_content5 . $_POST['carts'] . '';
  45.  
  46. //mail dla nas
  47. $headers = 'MIME-Version: 1.0' . "\r\n";
  48. $headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";
  49. $headers .= 'To:' . $from . '<' . $mail . '>' . "\r\n";
  50. $headers .= 'From: '. $_POST['name'] . ' ' . $_POST['surname'] . '<' . $_POST['mail'] . '>' . "\r\n";
  51. $content_seller=$mail_content_seller . 'Email: ' . $_POST['mail'] .'<br />Imię i Nazwisko: ' . $client
  52. . '<br />' . $mail_content_seller3 . ' '
  53. . $sugest;
  54. mail($mail, $subject_seller, $content_seller , $headers);
  55.  
  56. $url='Location:' . $adres . '?accept=ok';
  57. header($url);
  58. }
  59.  
  60. }
  61. else
  62. {
  63. $url='Location:' . $adres;
  64. header($url);
  65. }
  66. print_r($error);
  67.  
  68.  
  69. ?>
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: 18.10.2025 - 09:12