<input type='hidden' name='x_amount' value='<?php echo $x_amount; ?>' />
Yep, you're right - the problem is that the code sample is mixing up amount and x_amount, rather than using one or the other all the way through. amount is being used in the hashing, but x_amount is what's being put into the form.
I should also mention that the example code quoted is rather messy. It should be printed as a single block with embedded values, rather than having a million echo statements. For instance, something like this:
/* Create the HTML form containing necessary SIM post values
Additional fields can be added here as outlined in the SIM
integration guide at: http://developer.authorize.net */
print <<<BLOCK
<form method='post' action='$url' >
<input type='hidden' name='x_login' value='$loginID' />
<input type='hidden' name='x_amount' value='$x_amount' />
<input type='hidden' name='x_description' value='$x_description' />
...
BLOCK;
Putting a whole pile of variables into your global namespace is bad coding as well. I generally either process from $_POST (after the usual validation to prevent inserts or bugs), or transfer from post to a secondary array like $data. You can insert array variables into a print block by wrapping them in curly brackets, like so:
print <<<BLOCK
<form method='post' action='{$data['url']}' >
BLOCK;
Just thought I'd mention this because I started with echo and global variables and it just made for horribly sloppy code. I learned better back a few years ago.