I'd like to submit text to a script. I do not want to use GET method because it's very limited and don't want to use POST with text/url-encoded content type because characters have to be converted. Is there any other way to submit text??
Maybe in - a session - a plain text file on the server - a cookie ?
haha, oh yea 🙂 usual post get, session, cookie, post to dbase, post to file, store in picture, encrypt and send it to your moms email, you name it 🙂 there's tons of ways to send vars, just depends on what you wanna do with em!
use POST with text/plain type...
And after I POST text/plain, how do I ready it in PHP?
Um... why would "characters have to be converted"? The server is supposed to be doing that already.
Characters are have to be converted b/c a POST has var1=hondavar2=chevy
So & is used to separate variables.. And when a variable has & (exapmle: "honda&chevy") the & has to be converted to %26. So the POST would be
var=honda%20chevy&var2=toyota%20bmw
Like I said, the server takes care of converting those escape sequences into characters (and the client takes care of converting those characeters into escape sequences). If the user types "Honda & Chevy" in the field, the client encodes it as "Honda%20%26%20Chevy" or "Honda+%26+Chevy" depending on the client, and the server reconstructs the string as "Honda & Chevy" and that's the string PHP gets.
But I'm not submitting data using HTML forms. I want to send data from my PHP script to another script. So I manualy send all the http headers and stuff. And the & forces separation of variables 🙁
So, ah, use [man]urlencode/man. As before, the receiving server will decode it.
If you've got sufficient control over the machines involved (the client and the server), then a text/plain encoding might work, but you'll might have to do some work to get it parsed properly when it's received. So it doesn't sound like you'd be saving much.