Ah ok, I was unsure of whether it works so I stuck with PHP the functionality works with external PHP and getting the IP address in server side Java would take longer. I'll work on implementing this in java