Changing items in $_POST
| From: | Jeff Oien | Date: | Sat, 24 Jul 2004 01:20:43 +0000 |
| Subject: | Changing items in $_POST | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-191716@lists.php.net to get a copy of this message | ||
I have items from a form that will be in $_POST that I want to send on.
I'll be using this:
$arr = array();
foreach($_POST as $key => $value) {
$arr[] = $key.'='.urlencode($value);
}
$URL = "https://example.com/script.asp?".implode('&',$arr);
header("Location: $URL\n");
However, there are a few variables I need changed. For example, the people I'm sending it to need $rate_1m which is a mortgage rate but in $_POST there is $rate_1m1 (the whole number) and $rate_1m2 (the two numbers after the decimal). How do I get those two together and then discard the two numbers and only send $rate_1m? If that makes any sense.
Thanks.
Jeff