Reply to Re: i can not get addslashes/stripslashes to have the same effect on different servers

Your name:

Reply:


Posted by Todd on 01/24/07 01:06

lawrence k wrote:
> Ruben van Engelenburg wrote:
>> lawrence k wrote:
>>
>>> I'm working at two different companies right now, and so I'm dealing
>>> with 2 different servers, but I've been using this same class in all my
>>> code. One one server I have to uncomment the line with stripslashes. On
>>> the other server I need to leave it commented. Surely there is a way to
>>> make this code work on all servers?
>>>
>> Hi Lawrence,
>>
>> Just a guess: check your magic_quotes_gpc setting in php.ini. If it's
>> set to on turn it off and just use stripslashes and addslashes.
>
>
> I'm sure it is a product of magic_quotes_gpc, but isn't there a way to
> get PHP to work intelligently regardless of settings in the php.ini? I
> can't casually change the php.ini on either server since there is 30
> client sites on one machine and over 100 on the other machine. For all
> I know they've code on their sites that depend on whatever the current
> setting is for magic_quotes_gpc. I'd potentially be breaking live sites
> if I changed the php.ini file. That's just not an option. But isn't
> there a way to work around magic_quotes_gpc? I thought magic_quotes_gpc
> was suppose to work transparently?
>
if (get_magic_quotes_gpc()) {
doSomething();
} else {
doSomethingelse();
}


OR

If your server is apache you could add the following to your .htaccess file:

php_flag magic_quotes_gpc off

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация