Server might be set up with PHP, but page has .html extension, and the server probably isn't set up to parse all .html as PHP [that would be quite a bad idea performance-wise I think].
Missing ) error you can correct by escaping correctly second ':
though I'm not sure it is going to work anyway, since the PHP code is not going to be executed [unless you do have .html set up as another PHP extension].
You can change page's file extension to .php and see how it goes, though that can break some links etc.
You could set up all .html files to be interpreted as PHP, though this isn't a best solution.
And you can try, without changing any extensions, to make a PHP file in the same directory, for example getip.php :
Then add in your HEAD section the following:
echo 'getIP="' . $getIP . '"'