I dont know exactly what your using it for. I got this to work tho.
Filename : anything you want
<form action="test.php" method="POST">
<input id="username" name="username" type="text" size="15">
<BR>
<BR>
<input id="password" name="password" type="password" size="15">
<BR>
<input id="user_ip" name="user_ip" type="hidden">
<BR>
<input name="submit" type="submit">
</form>
Filename : test.php // or just change the action in the form
<?php
$username = $_POST['username'];
$password = $_POST['[password'];
$user_ip = $_SERVER['REMOTE_ADDR'];
echo "$username";
echo "<BR>";
echo "$password";
echo "<BR>";
echo "$user_ip";
?>