Witam mam ostatnimi czasy problem z moją stroną. Problem polega na tym że edytor nie chce wczytać obecnej wartości z bazy danych bez użycia funkcji „Odśwież” , próbowałem wczytywać stronę jeszcze raz za pomocą header ale to niestety nie pomaga…. Proszę o pomoc…

Oto kod edytora
  1. <?php
  2. include("../../fckeditor.php") ;
  3. ?>
  4. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  5. <html>
  6. <head>
  7. <title>FCKeditor - Sample</title>
  8. <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-2">
  9. <link href="../sample.css" rel="stylesheet" type="text/css" />
  10. <?
  11. $connection = mysql_connect('00000', '00000', '0000');
  12. $db = mysql_select_db('0000000', $connection);
  13.  
  14. $query = "SELECT ID, ZAW_PAGES FROM `bdskt` where ID=1";
  15. $result = mysql_query($query);
  16. while( $row = mysql_fetch_array( $result )){
  17. $zaw_bd .= $row[ 'ZAW_PAGES' ].'';
  18. }
  19. ?>
  20. </head>
  21. <body>
  22. <form action="edytor01_save.php" method="post">
  23. <?php
  24. $sBasePath = $_SERVER['PHP_SELF'] ;
  25. $sBasePath = substr( $sBasePath, 0, strpos( $sBasePath, "_samples" ) ) ;
  26. $oFCKeditor = new FCKeditor('FCKeditor1') ;
  27. $oFCKeditor->BasePath = $sBasePath ;
  28. $oFCKeditor->Value = $zaw_bd;
  29. $oFCKeditor->Create() ;
  30. ?>
  31. <br>
  32. <input type="submit" value="Zapisz">
  33. </form>
  34. </body>
  35. </html>
  36.  


A to strony zapisującej
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  2. <html>
  3. <head>
  4. <title>Save</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  6. <meta name="robots" content="noindex, nofollow">
  7. <link href="../sample.css" rel="stylesheet" type="text/css" >
  8. <?
  9. $connection = mysql_connect('XXXX', 'XXXX', 'XXXXX');
  10. $db = mysql_select_db('0000000', $connection);
  11. ?>
  12. </head>
  13. <body>
  14. <h1>Zapisywanie...</h1>
  15.  
  16.  
  17. <?php
  18.  
  19. if ( isset( $_POST ) )
  20. $postArray = &$_POST ; // 4.1.0 or later, use $_POST
  21. else
  22. $postArray = &$HTTP_POST_VARS ; // prior to 4.1.0, use HTTP_POST_VARS
  23.  
  24. foreach ( $postArray as $sForm => $value )
  25. {
  26. $postedValue = htmlspecialchars( stripslashes( $value ) ) ;
  27. else
  28. $postedValue = htmlspecialchars( $value ) ;
  29.  
  30. $zapytanie = "UPDATE `bdskt` SET `ZAW_PAGES` = '$value' WHERE `id`='1'";
  31. $idzapytania = mysql_query($zapytanie);
  32. $syscomplitedi = "001";
  33. if($syscomplitedi == "001")
  34. {
  35. header("Location: edytor01.php");
  36. }
  37. }
  38. ?>
  39. </body>
  40. </html>
  41.