Thread: uploading files
View Single Post
  #4 (permalink)  
Old May 24th, 2007, 09:55
ziggi ziggi is offline
New Member
Join Date: May 2007
Location: uk
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Talking Re: uploading files

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.
Reply With Quote