Your code looks like it is supposed to work! This is what I would do in this situation:
1. Remove all not-working variables, then put them back in one by one, testing the code with each addition, seeing what trips the system, etc.
2. Create a small scale simulation with some files that you use only for testing, like this:
UserTest.php:
<?
$firstname = 'John';
$lastname = 'Doe';
$email = 'johndoe@gmail.com';
$code = 'AVEP-SBU7-ND5K';
$orderref = '989062279';
header('Location: http://www.<your site="">.com/ReceiverTest.php?firstname='. $firstname .'&lastname='. $lastname .'&email='. $email .'&code='. $code .'&orderref='. $orderref;
?>
ReceiverTest.php:
<?
$firstname = $_GET['firstname'];
$lastname = $_GET['lastname'];
$email = $_GET['email'];
$code = $_GET['code'];
$orderref = $_GET['orderref'];
echo '
<html>
<head></head>
<body>
<h1>Returned Values:</h1>
<p>First Name:'. $firstname .'</p>
<p>Last Name:'. $lastname .'</p>
<p>Email:'. $email .'</p>
<p>Code:'. $code .'</p>
<p>Order Ref:'. $orderref .'</p>
</body>
</html>
';
?>
Then, save these files so that the first can call the second, then test it by opening UserTest.php and see what you see on ReceiverTest.php.
Hope this helps :-)