Your mistake is now easily visible. It is that server process your bit of code only after the form1 is submited or $form is empty. And the information is not stored into session and isn't transfered to next pages as an hidden input, like the other variables are.
So you have several posibilities:
1) To every place where you have this
<input type="hidden" name="package" value="<?=$package?>">
add another line
<input type="hidden" name="amount" value="<?=$amount?>">
2) Store the values into the session
or
3) process the mentioned bit of code before each script
You have carefully take a look when the " or ' should be used when you are asigning values to variables and when they should be used in HTML statements. There are more mistakes in your script.