Ok, I am a total newbie and cannot figure out where to place the trim function on a code that a developer created for a client. The current form places "\" before any apostrophe and I have googled solutions and tried placing functions in the file but everything I do breaks the client's form. Any help is appreciated.
The current structure is:
$dd_description = $_POST['dd_description'];
and the review page of the form is:
Description:<strong> '. $dd_description .'</strong><br />
I just cannot seem where to place the 'trim'
Just allowing unparsed POST variables to appear on a users webpage is NOT recommended for security reasons.
Have you tried adding stripslashes() to the code?
Description:<strong> '. stripslashes($dd_description) .'</strong><br />
I'd recommend securing the input data further, perhaps wrap strip_tags around it also at least.
Auto escaping apostrophes suggests that Magic Quotes is on. Here's how to disable Magic Quotes.
Magic Quotes may be protecting your SQL queries from SQL Injection, so proper investigation as to why it is on is required. If this is the case then it is recommended to convert the code to prepared statements, which don't require any string processing for SQL Injection.