It's not that the code you have given is not working. It's only that maybe the program counter of the system is not going to that destination page or that destination page is not capable yet to retrieve the values.
First of all, your code should be:-
header("Location: https://www.page.com/servlet/?encoding=UTF-8&oid=333&first_name=$first_name&last_name=$last_name");
exit();
The "exit()" function must be used after every "header()" function call, because the "header()" function is meant to redirect the current web page to the desired web page. However the execution of the script continues in the parent page, so you need to use the "exit()" function to stop its execution.
Now in the destination page, you need to write the following code, to retrieve the values:-
<?php
foreach ($_GET as $key => $val) {
$$key = $val;
}
echo "<br/>Encoding - ".$encoding;
echo "<br/>O ID - ".$oid;
echo "<br/>First name - ".$first_name;
echo "<br/>Last Name - ".$last_name;
?>
So you see I have just used the "$_GET" superglobal variable (click here to know more about it), to retrieve the values send from another page to this destination page.
Hope it helps.