Edit post give error chk out plz

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Edit post give error chk out plz

    hey guys......a problem in my ulkoi script

    when ever i edit post... and give space via spacebar


    then its show rnrnrnrn in all space which i give by my spacebar

    how i remove that.... i chk function.php but dnt get it via which code its happen so if u have idea than tell me

    see in image

    Click image for larger version

Name:	sp.png
Views:	1
Size:	7.5 KB
ID:	113049
    Last edited by 12345xmen; 22.03.13, 09:53.

    #2
    Its because mysql_real_escape string() used, replace those new lines with <br/> or change <br/> to nothing.

    PHP Code:
    $input = str_replace(array("\n", "\r", "\r\n"), '<br/>', $input); 
    
    <!DOCTYPE html PUBLIC "-//WAPFORUM.RS

    Comment


      #3
      where is put this code....................

      i put that code in bbcode function as

      $string = str_replace(array("\n", "\r", "\r\n"), '<br/>', $string);

      but still same problem !
      Last edited by 12345xmen; 22.03.13, 16:59.

      Comment


        #4
        You haven't posted the code, how can i tell you where? I just can assume that it is needed where the script reads the data, and where is that you should know.
        <!DOCTYPE html PUBLIC "-//WAPFORUM.RS

        Comment


          #5
          i paste that code in txt file unable to post here get blank page every time so


          that txt file have editpost.php and function.php


          now tell me where i add that code !
          Attached Files

          Comment


            #6
            Where mysql_real_escape string() is used.
            <!DOCTYPE html PUBLIC "-//WAPFORUM.RS

            Comment


              #7
              thats in init.php


              PHP Code:
              <?php
              
                  error_reporting(0); //
                  
                  include_once(dirname(dirname(__FILE__))."/include/settings.php");
                  include_once(dirname(dirname(__FILE__))."/lib/db.php");
                  include_once(dirname(dirname(__FILE__))."/lib/users.php");
                  include_once(dirname(dirname(__FILE__))."/lib/functions.php");
                  require_once(dirname(dirname(__FILE__))."/lib/sessions.php");
              
                  
                  $config->ip=$_SERVER['REMOTE_ADDR'];
                  $config->browser=$_SERVER['HTTP_USER_AGENT'];
                          
                  if(!get_magic_quotes_gpc())
                  {
                      $_GET = array_map('mysql_real_escape_string', $_GET);
                      $_POST = array_map('mysql_real_escape_string', $_POST); 
                      $_COOKIE = array_map('mysql_real_escape_string', $_COOKIE);
                  }
                  else
                  {  
                      $_GET = array_map('stripslashes', $_GET); 
                      $_POST = array_map('stripslashes', $_POST);          
                      $_COOKIE = array_map('stripslashes', $_COOKIE);
                      
                      $_GET = array_map('mysql_real_escape_string', $_GET); 
                      $_POST = array_map('mysql_real_escape_string', $_POST); 
                      $_COOKIE = array_map('mysql_real_escape_string', $_COOKIE);
                  }
                  
                  init_session();
                  
              
              
              ?>

              Comment


                #8
                problem solved
                and its in init.php and correct code is


                PHP Code:
                thats in init.php
                
                
                [PHP]<?php
                
                    error_reporting(0); //
                    
                    include_once("settings.php");
                
                    include_once(dirname(dirname(__FILE__))."/lib/db.php");
                    include_once(dirname(dirname(__FILE__))."/lib/users.php");
                    include_once(dirname(dirname(__FILE__))."/lib/functions.php");
                    require_once(dirname(dirname(__FILE__))."/lib/sessions.php");
                
                    
                    $config->ip=$_SERVER['REMOTE_ADDR'];
                    $config->browser=$_SERVER['HTTP_USER_AGENT'];
                            
                    if(!get_magic_quotes_gpc())
                    {
                        $_GET = array_map('mysql_real_escape_string', $_GET);
                        //$_POST = array_map('mysql_real_escape_string', $_POST); 
                        $_COOKIE = array_map('mysql_real_escape_string', $_COOKIE);
                    }
                    else
                    {  
                        $_GET = array_map('stripslashes', $_GET); 
                        //$_POST = array_map('stripslashes', $_POST);          
                        $_COOKIE = array_map('stripslashes', $_COOKIE);
                        
                        $_GET = array_map('mysql_real_escape_string', $_GET); 
                        //$_POST = array_map('mysql_real_escape_string', $_POST); 
                        $_COOKIE = array_map('mysql_real_escape_string', $_COOKIE);
                    }
                    
                    init_session();
                    
                
                
                ?>
                [/PHP]

                Comment

                Working...
                X