Well… let´s see if anybody…...
I´m under this situation, i build an options theme page, and i can export and import options using a textarea where i can copy and paste, or even save manualy into a .txt file.
That´s ok and works fine. But i was tring to save that into a text file, i could, but once i get the text file loaded to convet it on an update_option or similar via ddbb query, i fail.
And i fail using everything.
The problem is i can´t with the sanitize and html entities, for example, all & must be &, on the textarea no problem, but, if i just leave one & no-encoded, the uploader fails to create the option array and nothing is created.
Any ideas? I whis to know how to this, i was all day fighting with that.
ok, nevermind, i will get this in the next days for sure.
I notice that i´ve posted many threads pointing to “real” hard code wp theme (options mainly), and on those casese, 0 reply…. sometimes i forget that this is a place “only” to make money and not to share how to do it…. anyway, as i said, i will get soon.
I will keep my self as always, and if i can share and help, i´ll do, i do not keep secrets.
don´t take me wrong, this is what i feel.
rg, i am one of those guys who read with attention your posts with solutions and tricks. many thanks for your share.
I would recommend to use base64 en and decoding:
it is designed to make binary data survive transport through transport layers. This would work fine for import and export, however I don’t know if you want to be able to add additional options to a textarea and import them; then this probably wont be a useful solution. Nevertheless I thought it might be interesting
What I do in my options panel is to save all options in a single array in the database, for the export feature I serialize the array, base64 encode it then save it in a txt file with force download using php headers. then when its comes to the import, the user upload the txt file imported, base64 decode it then update the database option row with out unserializing and thats it
Oh! thank you guys i was starting to feel a little alone on the forum, i´m the only one from Uruguay, and in fact there are only a few active users from southamerica, so….
Ok, thanks again for the replys, i will take in consideration that.
I guess what i´m doing wrong is to keep on same export file, options and also the data stroed in there. For example in my text file i save all the entire array for the only one option field i use (yes wizylabs i use arrays as you) and then, some html text brake the imort, like ampersands and those things.
The strage thing is, when i echo the option array as string in the text area, the ampersands are unenecode, but on the ddbb filed are encoded…..
Any way… i will keep on this till i get it!