Question

I have a script on my local server which has some input tags where you can add some data which will be stored in a mysql database. On my local server, the data is added as it should but on my server, when I add data, symbols such as / and ' have a slash before them.

My server has no php.ini file and godaddy told me to add a php5.ini file to the root of me server. What should i add to the php5.ini file, I know it doesn't have to contain all the commands that a php.ini file would contain, just the ones that I wish to edit. So, what directives do I need to add?

Also should I add the php5.ini file in the same folder as my scrips or at the root of my server, where I can access all the other files from?

Was it helpful?

Solution

You can add the following lines to your configuration file to disable magic quotes:

magic_quotes_gpc = Off
magic_quotes_runtime = Off

Regarding the location of the php5.ini file, you will have to ask GoDaddy. It is not a common configuration to place such configuration files in the same place as your website files, so they have configured their servers in such a way to look for it. We can assume that the appropriate location is the top-level directory that holds your website files, but asking GoDaddy is the only way to know for sure.

OTHER TIPS

<?php
  ini_set("magic_quotes_gpc",0)
  ini_set("magic_quotes_runtime",0)
?>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top