onchange is Javascript function. Javascript processes on the CLIENT side only (in the browser).
The PHP function you wrote works ONLY on the SERVER side, after form values are submitted. The php function you wrote does NOTHING AT ALL when the user changes a value because the form is not being submitted.
for example
<input type="Text" name="login_v" onchange="changed(this)" maxlength="15" size="20" class="text">
<script>
function changed(inputobject)
alert("Your new value is "+inputobject.value);
</script>
You can use the javascript function to adjust the values in the form before they are submitted to php.
To use javascript to sumbit values to the PHP server, you could say:
onchange='window.location=myPHPscript.php?value1=x&value2=y';
etc.
Your PHP script would then process the variables and return a fresh page to the user.
A more difficult but very doable approach is this:
Include a nearly invisible (ie 1-pixel) iframe in your page.
Use javascript to pass a value to a php script on your server, like
parent.MyIframe.location=myPhpPage.php?mypassedValue
Then capture the returned value from the iframe after processing:
myParentElement.value=parent.MyIframe.MyElement.value
there are examples of this approach floating around the internet. I use this method very often to good effect.