401 Authorization Required

I am trying to connect to the Tamino database with the following code:

<?php

require_once("TaminoAPI.php");
require_once("TaminoHelperFunctions.php");


// create TaminoAPI object
$tamino = &new TaminoAPI("ssl://server.name.com",443,"test1","username","********");            

$tamino->setHttpRequestMethod("POST");
$tamino->setCollection("collection");

$results = new DOMDocument();


$query = "input()/quiz";

if(!$tamino->xquery($query)){
	thfPrintError($tamino);
	}
	else{
		$tamino->printResultBody();
		}	

?>

This code worked great for a previous project I was working on that had a different login, but when I change the username and password to the new account that I am working with it gives me a 401 Authorization Required error. I am absolutely sure that the username and password I am using are correct and I can access the database through the Tamino Interactive Interface with them. Any suggestions?

Scott has solved this problem. He had to escape some special characters in his password.