Help: PHP, Actionscripting login

Hi, I am having trouble to get the SendAndLoad() function to work correctly so that when the php script echo’s or print(“result”) is called it gets a string saying pass, or fail… the following is my code for php, and action script. Also I have provided two pictures explaining the what exactly I want… Any help is very appreciated.

Thanks
-Jon

<?php

$host = "localhost";
$usr = "********";
$pss = "********";
$dbselect = "test";
$username = $_POST['username1'];
$password = $_POST['password1'];

mysql_connect($host, $usr, $pss) or die(mysql_error());
mysql_select_db($dbselect);

$result = mysql_query("SELECT * FROM login") or die(mysql_error());
$getUsrnames;
$getPasswords;
while($string = mysql_fetch_array($result))
{ 
     $getUsrnames .= $string['name']." ";
    $getPasswords .= $string['password']." ";
}
$Usrnames = explode(" ", $getUsrnames);
$Passwords = explode(" ", $getPasswords);
$check = false;
$int = 0;
for($i = 0; $i &lt; count($Usrnames); $i++) 
 {
         if(strcmp($username, $Usrnames[$i])== 0)
         {
             $check = true;
             $int = $i;
         }
         
 }
 $passorfail = "";
 if(strcmp($password,$Passwords[$int]) == 0)
         $passorfail = "success";
         else $passorfail = "failure";
    
                             
print ("processed1=$passorfail");

?>
//This script does work with an html form, where the user is just redirected if the
//passwords match, otherwise they are redirected to failure.php and redirected then
//back to the login.htm page

-------------------------ActionSCRIPT---------------------------

on(press)
{
var1 = user.text;
var2 = pass.text;

 envelope = new LoadVars();
 envelope_received = new LoadVars();

 envelope.username1 = var1;
 envelope.password1 = var2;
 envolope_received.processed1 = "default";
 envelope.SendAndLoad("http://www.nemuspaper.com/process.php",             envelope_received, "POST");
 the_status = envelope_received.processed1;
 proc.text = the_status+var1+var2; 

}

//The on press is called from the login button. for the input text fields I used the
instance name instead of the Var name because otherwise it would not display the
values in the dynamic field that states what the php script returns and the username
and password from the input fields. I used sendAndLoad, and “POST” as the method
which then I used $_POST array in the php, I have tried the HTTP_POST_VARS array.

Here is the image before typing anything in

Here is the image of what the script actually does

-Again, thanks for any help.