Cardale Posted November 21, 2009 Share Posted November 21, 2009 I am dealing with C code and I need to make sure it is encoded some how to ensure its integrity and then decoded. For security and later readability. Quote Link to comment https://forums.phpfreaks.com/topic/182376-dealing-with-code-in-db-query/ Share on other sites More sharing options...
genericnumber1 Posted November 21, 2009 Share Posted November 21, 2009 I'm not sure I understand your question, could you put it in question form and add some more detail? Quote Link to comment https://forums.phpfreaks.com/topic/182376-dealing-with-code-in-db-query/#findComment-962406 Share on other sites More sharing options...
Cardale Posted November 21, 2009 Author Share Posted November 21, 2009 Well I don't have the code yet, but I want to add C code from a form(user input) and place it into my database. How should I do this safely? Excuse me I do know of addslashes($val); htmlspecialchars($val); but when I look in my database it is just raw code. I would like to avoid complex injection if it is at all possible with maybe some encoding method or what not? Quote Link to comment https://forums.phpfreaks.com/topic/182376-dealing-with-code-in-db-query/#findComment-962410 Share on other sites More sharing options...
genericnumber1 Posted November 21, 2009 Share Posted November 21, 2009 It shouldn't be too much worry, just use mysql_real_escape_string or a comparable method for your DB (or prepared statements) and you should be fine. If you're asking what encoding your database table should be in, I'm always fond of Unicode, but any regular latin encoding should work just fine. Quote Link to comment https://forums.phpfreaks.com/topic/182376-dealing-with-code-in-db-query/#findComment-962413 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.