Skip to main content

Posts

Showing posts with the label php4

Escaping quotes - moving from PHP4 to PHP5

I've inherited a php4 site that needs to run on my PHP5 Server, I've solved most of the issues but can't figure out what the author was trying to do here. Well, to be precise, he was tring to quote the submitted text but I'm not sure how this function is supposed to work and how I should do it in PHP5? # Function to safely add slashes when magic quotes is switched off function safe_slash($string) { if (!get_magic_quotes_gpc()) { $string = addslashes($string); } return $string; }