Say I request this URL:
http://mydomain.com/script.php?var=2+2
$_GET[‘var’] will now be: “2 2” where it should be “2+2”
Obviously I could encode the data before sending and then decode it, but I’m wondering if this is the only solution. I could also replace spaces with plus symbols, but I want to allow spaces as well. I simply want whatever characters were passed, without any url decoding or encoding going on. Thank you!
Of course. You could read out
$_SERVER["QUERY_STRING"], break it up yourself, and then forgo the usual URL decoding, or only convert%xxplaceholders back.(Example only works for alphanumeric parameters, and doesn’t do the mentioned %xx decoding. Just breaks up the raw input.)