BR
asked on
Php form output
Dear experts,
I use below string to escape from sql injection,
$comment = $mysqli->real_escape_strin g($comment );
But the output has /r/n
Should i store the customer comment data like this?
What do you suggest i should do?
I also email this output
I can send the original message email store the data like this?
I use below string to escape from sql injection,
$comment = $mysqli->real_escape_strin
But the output has /r/n
Should i store the customer comment data like this?
What do you suggest i should do?
I also email this output
I can send the original message email store the data like this?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I totally agree with Ray , its up to you whether you save it or not after all if you are going to show \r\n on client side it will not show any thing !.
... it will not show any thingThat's almost right. It will show something, and that something will be only a single blank (space) character. Browsers collapse consecutive whitespace characters into a single blank. That means that five blanks looks the same in the browser viewport as one blank. Three tabs and a line feed? Looks like one blank. One blank? Looks like one blank. Forty-five EOL characters? Yep, you guessed it!
You can tell these things apart by using "view source" to see where the rendered document contains the original formatting characters.
You can also use the <pre> tag in HTML to see the original formatting. You can't readily tell the \r from the \n (no visual cue) but you can see most of the formatting.
This is a data-dependent question, with a lot of widely variable context. When you have questions like this one, it's wise to show us your test data, and tell us how the data is going to be used. Then we can provide more focused responses, and maybe even code examples.