Lodius2000 Posted June 5, 2008 Share Posted June 5, 2008 So i am designing a simple blog cms and i have gotten to where I can insert values into my table and pull them back out, my question is when I submit a value like I've been thinking to a varchar or text field it automatically escapes the ' making the string read I\'ve been thinking problem is when I go to pull it back from the database, out to php, it still prints the escape \. question 1. is there a php or mysql function that would convert those back into their correct characters upon SELECTion, though it reads wrong it is a minor annoyance in text but is wreaking havoc on file paths for <img> and <embed> tags ie <embed src=\"/video/052108laugher.mov\" height=\"256\" width=\"320\" autoplay=\"false\" type=\"video/quicktime\" pluginspage=\"http://www.apple.com/quicktime/download/\"> should be <embed src="/video/052108laugher.mov" height="256" width="320" autoplay="false" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/"> question 2 which brings up the second part of the question, does this magical php or mysql function leave < and > intact so that my entries can have html embedded in them, i know htmlentities wont help for that but I hope there is a way if there is not a function, and it is much more complicated, a little nudge in the right direction to research would be appreciated Thanks in advance Quote Link to comment https://forums.phpfreaks.com/topic/108909-solved-insert-and-escaping-characters/ Share on other sites More sharing options...
.josh Posted June 5, 2008 Share Posted June 5, 2008 stripslashes() Quote Link to comment https://forums.phpfreaks.com/topic/108909-solved-insert-and-escaping-characters/#findComment-558704 Share on other sites More sharing options...
Lodius2000 Posted June 5, 2008 Author Share Posted June 5, 2008 perfect SOLVED Quote Link to comment https://forums.phpfreaks.com/topic/108909-solved-insert-and-escaping-characters/#findComment-558731 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.