keep in mind that php is a case sensitive language.
there is no variable in php names;
$_cookie
to reference cookies, sessions, form post or URLS, you must use capitols:
$_COOKIE
your echo line had the correct case:
<?php echo((isset($_COOKIE["ipaddress"]))?$_COOKIE["ipaddress"]:"") ?>
but your if statement does not:
if (isset($_cookie["ipaddress"])) {
it should be:
if (isset($_COOKIE["ipaddress"])) {