hassank1 Posted January 9, 2009 Share Posted January 9, 2009 I've used the js function uriencodecomponent() to transform unicde text and symbol in text area to their equivalend hex here's an output example : Testing%20%D8%B9%D8%B1%D8%A8%D9%8A%20%26%20 then I submit the form and save it to mysql.. the issue is that the above text is tranformed to unicode characters when save in mysql table..and even if I try to manually enter the above text manually using phpmyadmin .. when I try to fetch it from database using php, new characters are added.. what I simply need is when I submit a textbox that contains these values I want it to be saved as it is in the database.. and when I retreive it I want it to be retreive as it is also how can I do that ? thx Link to comment https://forums.phpfreaks.com/topic/140126-save-hexadecimal-to-mysql/ Share on other sites More sharing options...
gevans Posted January 9, 2009 Share Posted January 9, 2009 Instead of using urlencoding leave the text as is while it gets 'posted' and secure from sql injections using mysql_real_escape_string() Link to comment https://forums.phpfreaks.com/topic/140126-save-hexadecimal-to-mysql/#findComment-733189 Share on other sites More sharing options...
redarrow Posted January 9, 2009 Share Posted January 9, 2009 Dont you need the database set to a longblob to use hex <<<<<<<<<< want to just point out that hex is a vulnerability to be allowed to be entred in the database. according to the new php books, published from 2008 that hex can be used for mysql injection. only pointing it out as it seems entering hex in a database can cause mysql injection. Link to comment https://forums.phpfreaks.com/topic/140126-save-hexadecimal-to-mysql/#findComment-733194 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.