Google maps Draggable Markers and showing in <input value="" />

Google maps Draggable Markers and showing in <input value="" />

Hy 
I found this script for recording a latitude and longitude to a text file using php , but I would like to show parametars lat and lng in html <input type="text" value="lat" /> and <input type="text" value="lng" />  direct on the curent page without refreshing the page
I found this page and I'm asuming that is posible to do that

And I also find a asp version of what i need and that version haw all what i need , but its writen in ASP and I nede it in PHP 
please help 

Thanks in advance and sorry for bad EN