One problem I see is here:
$uploader->pass_var('whicharea','$_SESSION[temp_name]');
For the value of the second parameter of pass_var(), you've passed a string that contains a dollar sign, an underscore, the word 'SESSION', and "temp_name" surrounded by square brackets.
In halojoy's code, however, the value of the variable $_SESSION['temp_name'] is being passed. The difference is that you surroudned the variable with single quotes, and variable parsing is only done in double-quoted strings (but since you're only using the value of a variable, it's pointless to add any quotes at all).