loadVars Problem

Hi everyone. I am slowly picking up actionscript, and I have hit a wall. I have a PHP script called “login.php” that passes on a single variable to flash &name=$name, which is a username that has been passed into the login.php from a form. All I want to do is get flash to display the username using in a dynamic text field, which is a variable called “name”. This is the AS I am using:

username = new LoadVars();
username.load(“login.php”);
username.onLoad = function(success){

  if (username.loaded) {
	name = username.load
	
}

}

and here is the PHP script (note that the echo passing the variables is towards the bottom of the script):

<?php
session_start();
?>

<html>
<BODY bgcolor="#C21414"> <FONT COLOR="#FFFFFF">

<?php
include "db_login.php"; 

$name = $_POST ['usrname'];
 


$result = "select * from login WHERE usrname = '$_POST[usrname]' AND pass = '$_POST[pass]'"; 

mysql_query($result);

if(mysql_affected_rows() == 0)
{
print("<h1>You were not logged in. Please return to the login page and try again, or, if you do not have an account, create one using the online registration form.</h1>");
	}
else
	{
echo "<center><h2>You are now logged in! Please wait a few seconds while I load the members area for you. . .</h2></center>";
}

echo "&name=$name";

?>

<head>
<meta http-equiv="refresh" content="5;URL=http://www.webby.com"> 
</head>


</html>


When I try to run the scripts, all that appears in the variable is [type function]. . .Does anyone know what I am doing wrong? Thanks in advance for your time!