Hi there,
I've just started diving into PHP myself, but here's a piece that worked for me.
<a href="http://<SERVERNAME or IP>/targeted_file.php?ip=123.45.123.45&anothervar='some text'">Click Me</a>
I just linked to the other php-page checking if $ip is present and if so, writing it to the screen.
Doesn't even get stuck with the dots between the numbers.
Hope it helps