The best way would be to use code such as this:
$uid = (@$_GET['uid'] ? $_GET['uid'] : '');
that way you won't get "Undefined Variable" errors when it's not in the URL.
Before, it sounds like your old server had 'register_globals' set to On, which is a security risk. For more information about this security risk, you can search the board for 'register_globals' or 'register globals.'