Edit post give error chk out plz

Started on the old forum in March 2013 · view the original in the archive · old links redirect here

7 replies · 516 views · started 13 years ago · 1 min read

2 participants
12345xmen Developer · 239 posts #1

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

Attachments: sp.png
arnage Lead · 811 posts #2

Its because mysql_real_escape string() used, replace those new lines with or change to nothing.

$input = str_replace(array("\n", "\r", "\r\n"), '<br/>', $input);
<!DOCTYPE html PUBLIC "-//***WAPFORUM**.**RS***
12345xmen Developer · 239 posts #3

where is put this code....................

i put that code in bbcode function as

$string = str_replace(array("\n", "\r", "\r\n"), ' ', $string);

but still same problem !

arnage Lead · 811 posts #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***
12345xmen Developer · 239 posts #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 !

Attachments: code.txt
arnage Lead · 811 posts #6

Where mysql_real_escape string() is used.

<!DOCTYPE html PUBLIC "-//***WAPFORUM**.**RS***
12345xmen Developer · 239 posts #7

thats in init.php

<?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();
	

?>
12345xmen Developer · 239 posts #8

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

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();
	

?>

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close