Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [PHP]punbb i łączenie z inną stroną
Forum PHP.pl > Forum > Przedszkole
kavillock
znalazłem gdzieś na forum jak połączyć punbb z własną stroną (formularz logowania)

lecz wywala błąd

Warning: Cannot modify header information - headers already sent by (output started at C:\Documents and Settings\dom\Moje dokumenty\site\forum2.php:6) in C:\Documents and Settings\dom\Moje dokumenty\site\forum\include\functions.php on line 152

Warning: Cannot modify header information - headers already sent by (output started at C:\Documents and Settings\dom\Moje dokumenty\site\forum2.php:6) in C:\Documents and Settings\dom\Moje dokumenty\site\forum\include\functions.php on line 155


kod

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. </head>
  5. <body bgcolor="#1E1E1E">
  6. <?
  7. // Define the path to the forum root
  8. @define('FORUM_ROOT', 'forum/');
  9. require FORUM_ROOT.'include/common.php';
  10.  
  11. // Where will we go after login?
  12. $forum_page['redirect_url'] = 'http://localhost/forum';
  13.  
  14. $forum_page['form_action'] = forum_link($forum_url['login']);
  15.  
  16. $forum_page['hidden_fields'] = array(
  17. 'form_sent' => '<input type="hidden" name="form_sent" value="1" />',
  18. 'redirect_url' => '<input type="hidden" name="redirect_url" value="'.forum_htmlencode($forum_page['redirect_url']).'" />',
  19. 'csrf_token' => '<input type="hidden" name="csrf_token" value="'.generate_form_token($forum_page['form_action']).'" />'
  20. );
  21.  
  22. ?>
  23. <form method="post" action="<?php echo $forum_page['form_action'] ?>">
  24. <?php echo implode("\n\t\t", $forum_page['hidden_fields'])."\n" ?>
  25.  
  26. Username:
  27. <input type="text" id="fld1" name="req_username" value="" />
  28. <br />
  29.  
  30. <input type="hidden" id="fld2" name="req_password" value="asdf" />
  31.  
  32. <input type="checkbox" id="fld3" name="save_pass" value="1" />
  33. <label for="fld3">Log me in automatically each time I visit.</label>
  34. <br />
  35.  
  36. <input type="submit" name="login" value="Login" />
  37. </form>
  38. </body>
  39. </html>


jmail
no to nam chyba za dużo nie pomoże. trzeba znaleźć w którym miejscu jest wywoływana funkcje header() bo to o nią chodzi i zrobić tak, żeby przed nią nic nie mogło być wysłane do przeglądarki. Było wiele razy na forum - poszukaj
kavillock
szukałem, funkcje header usunąłem bo byla niepotrzebna natomiast zostało jeszcze:


  1. if (version_compare(PHP_VERSION, '5.2.0', '>='))
  2. setcookie($name, $value, $expire, $cookie_path, $cookie_domain, $cookie_secure, true);
  3. else
  4. setcookie($name, $value, $expire, $cookie_path.'; HttpOnly', $cookie_domain, $cookie_secure);
  5. }
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.