Let's say I have a form
<form method="POST">
Name: <input type="text" name="Name" /><br />
Email: <input type="text" name="Email Address" /><br />
<input type="hidden" name="mandatoryfields" value="Name,Email Address" />
<input type="submit / >
And post this to PHP. I am dynamically checking that the fields in mandatoryfields have something in them.
Now if I create an array from the mandatoryfields and check
if ($_POST[$mandatoryfieldsarray[$i] == "") {
$errorcheck = 1;
}
whilst looping through the array
Now it works fine for any posted variable that DOESN'T contain a space in it. However what I need to know is what the encoded character is in a form post for a space so I can check it (echoing it seems to be fine by looping through the $_POST array but actually calling $_POST['Email Address'] is blank).