Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
.htaccess magic_quotes_gpc & virtual hosting
Old 10-14-2002, 03:35 PM .htaccess magic_quotes_gpc & virtual hosting
Junior Talker

Posts: 3
Trades: 0
I know it's possible to be able to turn magic_quotes on for particular sites on a virtual host by using .htaccess...

I have tried putting in the following:

php_flag magic_quotes_gpc on

to an already exisiting .htaccess page which deals with .htaccess security but when accessing a page which is covered by .htaccess, an 'internal error' message occurs and page is not viewable.

It would be fantastic if someone can tell me exactly how to use .htaccess to control magic_quotes - they are currently set to 'off' in php.ini and I do not want to change this apart from this one site that requires them on (due to external developer programming the site and I can't read his code therefore do not know where to addslashes!!!)

Any advise would of course be appreciated.
fumanshu is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 10-14-2002, 05:53 PM
dk01's Avatar
Ultra Talker

Posts: 373
Location: Ames, IA
Trades: 0
Check out this page:
http://mynews.alienated.org/story.php/view/5/

It says you need to have "AllowOverrides All" set in your apache config. Just a guess.
-dk
__________________
Did I help you? If so, be nice and throw me some
Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
dk01 is offline
Reply With Quote
View Public Profile
 
Old 10-14-2002, 07:44 PM
AhmedF's Avatar
Left for Better Places

Posts: 258
Trades: 0
ARGH!!!

http://www.webmasterstop.com/tutoria...c-quotes.shtml

That should explain it all!
AhmedF is offline
Reply With Quote
View Public Profile
 
Old 10-15-2002, 06:22 AM
Junior Talker

Posts: 3
Trades: 0
Thank you for both your replies, however as I'm not very familiar with the workings of httpd config file, I'm not too sure where abouts to place the AllowOverideAll line. I've just tried placing it with the rest of the virual directory settings, but apache told me (when restarted) that it wasn't allowed there!!

Re second reply - the article you pointed me to (which i had in fact read) was very funny and did raise a few good points - especialy regarding the use of stripslashes etc - however, it doesn't really tell you very much in terms of how to do certain things i.e. what do you type in to the .htaccess file and where and what do you type in in the httpd config file!!

Thank you anyway. If there is anyone else out there who can advise, it will be most welcome.

F
fumanshu is offline
Reply With Quote
View Public Profile
 
Old 10-15-2002, 07:34 AM
AhmedF's Avatar
Left for Better Places

Posts: 258
Trades: 0
I was focusing more towards the 'DO NOT USE THIS METHOD' angle than in solving the dilemme of the .htaccess problem

Regarding the AllowOverideAll ... it is a tag in the main apache conf file which allows you to set up a .htaccess to override the PHP settings.

I will look into it ... lemme get back to you
AhmedF is offline
Reply With Quote
View Public Profile
 
Old 10-15-2002, 07:44 AM
Junior Talker

Posts: 3
Trades: 0
I'm with you on not using magic_quotes - in fact I would so much rather use addslashes so we're talking the same language BUT i have been left with no choice as I cannot read my developers code so as to change it (I'm still learning PHP) and my client is having problems adding content through their content management system.

This bug somehow slipped through the net at testing stage and now I cannot get hold of the developer!!

!!
fumanshu is offline
Reply With Quote
View Public Profile
 
Old 07-22-2003, 10:56 PM
Junior Talker

Posts: 1
Location: Philadelphia, PA, US
Trades: 0
if you're stuck with:
magic_quotes_gpc = On

$var =
str_replace( array( "\\\"", "\\'"), array(""", "'"), $var );

in the script that receives the post/get from the form has been working for me quite nicely.
__________________
Respectfully Submitted,

Ken Ehrman

Please login or register to view this content. Registration is FREE
groggyjava is offline
Reply With Quote
View Public Profile Visit groggyjava's homepage!
 
Reply     « Reply to .htaccess magic_quotes_gpc & virtual hosting
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.24611 seconds with 12 queries