Contact form processor not getting value
I generally use a self submitting form and processor all in one to keep things clean, but the project I'm working on uses an HTML form that POSTS to a separate PHP script that handles the mailing.
The email will go to different users based on the query string in the URL like:
index.php?page=contact&user=User%20One
Will go to to User One's email address
In the form I have a hidden field that grabs the user from the URL
Code:
<input type="hidden" name="user" value="User One">
In the processing script I have
PHP Code:
switch ($_POST['user']) {
case "user%20One":
$owner_email = "user_one@domain.com";
break;
case "user%20Two":
$owner_email = "user_two@domain.com";
break;
default:
$owner_email = "default@domain.com";
break;
}
mail($owner_email, $subject, ...rest of mail function...
My issue is getting the specific "user" value to the processing form to be able to email the correct user. Any help would be appreciated, thank you.