Variable Scope and functions, whats wrong!?

Okay, so I’ve been messing around with this for the past couple days. I’ve read some of these threads on the forum, and can’t really put my head around what I’m doing wrong

Heres the code:

<? 
 
include("includes/common.php");
 
if (isset($_POST["FormName"])) {
    InsertNewEmailAddress($_POST["email_address"],$_POST["bm_zipcode"]);
}
 
function InsertNewEmailAddress($EmailAddress,$ZipCode) {
 
$strConnect = mysql_connect($Server,$Username,$Password);
if ($strConnect) {
    die('Could not connect: ' . mysql_error());
}
 
mysql_select_db($DatabaseName, $strConnect);
 
$sql = "INSERT CODE GOES HERE"; 
 
if (!mysql_query($sql,$strConnect)) {
   die('Error: ' . mysql_error());
}
echo "1 record added";
 
mysql_close($strConnect); 
}
?>

Inside common.php:


$Server = "localhost";
$Username = "MyUsername";
$Password = "MyPassword";
$DatabaseName = "MyDatabase";

I have a form, that posts to this, and thats all fine, but I get this error when trying to connect:

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'nobody'@'localhost' (using password: NO) in /test/mailer.php on line 13 

I’m losing the variables somehow and don’t know how to fix it!!

Thanks in advance.