Help - Search - Members - Calendar
Full Version: Magic Quotes
Hostony Board > General Support > PHP/MySQL
nwkeeley
I am about to purchase a domain / package w/ hostony in just a few days and I was wondering if they have magic quotes turned on to avoid the nasty problems that arise with php/mysql and ' 's in forms. Or if it is an option to the user to turn on magic quotes.
Niakie
On the server I am on (16) magic_quotes_gpc is on, you can avoid all the problems by useing a simple function that will check to see if magic quotes is on or not and if not parse the string for you.

CODE
function safeAddSlashes($string) {
 if(get_magic_quotes_gpc()) {
   return $string;
 } else {
   return addslashes($string);
 }
}


Then all you would have to do is call that before saveing information to the database and yer all set regardless of what the setting is, this avoids a lot of problems down the road if the default settings change or for some reason Hostony decides to change settings.
MartinB
you can configure your own php settings using a .htaccess file in your directory, like:

CODE
php_flag magic_quotes_gpc on
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2024 Invision Power Services, Inc.
IPS Driver Error

IPS Driver Error

There appears to be an error with the database.
You can try to refresh the page by clicking here