Hi I added a addslash before submit to database like

$bio=addslashes($_POST('bio'));

it will add a "\'" before submit .. and everything working fine .. but at the time of edit/ resubmit this form I am getting the following out put

This is old\\' Line
This is new\' Line

Please help me to avoid this issue ..
Thanks in advance

Member Avatar for diafol

Addslashes is limited. If you want to display input info safely use htmlentities() or htmlspecialchars(). If you want to input to DB, use the db-specific sanitizer, e.g. mysql_real_escape_string.

when use

addslashes()

then the opposite is

stripslashes()

that's all you need.

hope this helps

Hi I added a addslash before submit to database like

[

$bio=addslashes($_POST('bio'));
[/code]

it will add a "\'" before submit .. and everything working fine .. but at the time of edit/ resubmit this form I am getting the following out put

This is old\\' Line
This is new\' Line

Please help me to avoid this issue ..
Thanks in advance

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.