Problem solved!
Thanks for replying to my post guys it's really appreciated.
I'm a web designer whose recently moved into development via
PHP & MySQL.
I've come across this e-commerce checkout script and have tried to edit it for my own purpose, so I really have no idea whether:
escape_data()
is common to
PHP or not -being a novice I'll take your word that it isn't. However its aim is apparently to validate the information entered into text forms and escape any problematic characters.
// Function for escaping and trimming form data.
function escape_data ($data) {
global $dbc;
if (ini_get('magic_quotes_gpc')) {
$data = stripslashes($data);
}
return mysql_real_escape_string (trim ($data), $dbc);
} // End of escape_data() function.
Adding this code solves the problem. But I now understand that in current versions of
PHP 'Magic Quotes' are turned off by default in the
php.ini file.
So I'll have to check mine!
Thanks again.