calabiyau Posted February 2, 2008 Share Posted February 2, 2008 I am building my own framework and have used "editarea" as my online code editor. I use ajax to open and save files from the server. everything is working properly, except one thing. I discovered that in order to get the save to work I had to use the javascript escape() function before sending the post request to the server, otherwise the & symbols in the code messed up the post request. Now the problem is if the code contains something like this: $server_path = "C:\server\apache\www"; When it saves the file, it comes out like this: $server_path = "C:serverapachewww"; I do a strip slashes on the php receiving end before saving the file to get rid of the escapes created by the javascript end, and through alerts discovered that that is not the problem. They are being eliminated before the ajax request is sent. Anybody have any ideas on how to resolve this problem? Am I using the wrong approach? Quote Link to comment Share on other sites More sharing options...
calabiyau Posted February 2, 2008 Author Share Posted February 2, 2008 Okay my mistake, on further investigation, the ajax side was okay, needed html_entity_dedode on the php side to convert the characters back. Everything works great now. For anyone who isn't clear on the relationships between ajax and php, this website has a neat little gadget that explains how they all relate http://www.the-art-of-web.com/javascript/escape/ Quote Link to comment 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.