thered Posted February 3, 2008 Share Posted February 3, 2008 Hi I'm a bit if a beginner but have done a few small websites. I've just been in touch with my hosting company and they have magic_quotes on and can't turn them off as it's a shared server, fair enough. I'm not sure this is my problem anyway I write information which has been cut and pasted from a word processor to a mysql database - for this I use addslashes() and to write it to the webpage I use stripslashes() - this works ok. Until today, when I decided to move into the murky world of AJAX. When I return stuff now from the database I get strange characters - a diamond with a '?' in it. I've Googled this but most stuff tell me to turn off magic_quotes or hack the .htaccess file -neither it seems I have access to. Any ideas why it doesn't work with httpRequest stuff? cheers TIA Quote Link to comment https://forums.phpfreaks.com/topic/89247-getting-my-head-around-stripslashes/ Share on other sites More sharing options...
Aureole Posted February 3, 2008 Share Posted February 3, 2008 No doubt, it's something to do with character sets and character encoding and all that malarkey. That's pretty much all I can tell you. HOWEVER... I write information which has been cut and pasted from a word processor Oh really? Try copying the information from the word processor, into a program like Notepad. THEN copy it into the Database, tell me what happens. Quote Link to comment https://forums.phpfreaks.com/topic/89247-getting-my-head-around-stripslashes/#findComment-456986 Share on other sites More sharing options...
thered Posted February 3, 2008 Author Share Posted February 3, 2008 Sorry, I probably didn't describe that too well. It is cut and pasted into a 'textarea' in a form then inserted to the database using addslashes. This is carried out by the girls in the office so making another step of putting into a text editor first won't be met with smiles However I'll try it tomorrow. Anyway, as already said, it works ok normally -it's just when I get the information using AJAX that it adds the special characters (or doesn't remove them) Quote Link to comment https://forums.phpfreaks.com/topic/89247-getting-my-head-around-stripslashes/#findComment-456995 Share on other sites More sharing options...
Aureole Posted February 3, 2008 Share Posted February 3, 2008 All I'm saying is, Word Processors have a habit of ... adding weird characters into things. If you copy it into Notepad (just as a test, it's not like the "Office girls" will have to do this all the time!) then copy it into the Database and see if you still get the problems. Anyway, no doubt someone else will come along and be able to fix your problems... I tried. Quote Link to comment https://forums.phpfreaks.com/topic/89247-getting-my-head-around-stripslashes/#findComment-457000 Share on other sites More sharing options...
thered Posted February 4, 2008 Author Share Posted February 4, 2008 Ok, tried it using a text editor -made no difference at all anyone? Quote Link to comment https://forums.phpfreaks.com/topic/89247-getting-my-head-around-stripslashes/#findComment-457526 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.