I have a form and it has checks in place that make sure that required fields are filled in. If the checks fail, the user is redirected to the original form. I use the $_POST data and re-fill in the completed parts of the form using URL parameters. The problem is that when the $_POST data is added to the redirect URL as a parameter, the spaces in the field are scrubbed.
e.g.
Form field 'question' is filled in with "this is a test" and processed as
$qtitle = $_POST['question'];
Check fails and the user is redirected like so
wp_redirect('http://www.example.com/submit-question/?err=2&qtl='.$qtitle);
The form then redisplays the form field 'question', pulling from the qtl parameter, as "thisisatest"
Why is it stripping the spaces and how can I fix it?