And to elaborate...
You should never reference an array item which might not exist - especially with incoming data. Here's how I often handle such situations in a script like yours:
$site = (isset($_GET['site']) ? $_GET['site'] : '');
// Now replace every reference to $_GET['site'] with $site
This uses the ternary operator, which is basically a shorthand way of doing:
if(isset($_GET['site'])
{
$site = $_GET['site'];
}
else
{
$site = '';
}
[man]isset/man or [man]empty/man are two common ways to check whether a variable exists before using it.