your ip has been logged for nefarious porpoises

Code:

<html>
<head>
<title>PHP TEST YAHHH</title>
<link rel="stylesheet" type="text/css" href="mystyle.css">
</head>
<body>

<div class="topbar">
<?php
include 'navbar.php';
?>

</div>


<?php
    
    //ex 11.3
    //write all IP addresses of visitors to a txt file
    
    $ip = $_SERVER['REMOTE_ADDR'];
    $ipFormat = "\n";
    
    echo $mainContent;
    
    $my_file = "ip.txt";
    $handle = fopen($my_file, "a") or die("Cannot open file: ".$my_file);
    fwrite($handle, $ip);
    fwrite($handle, $ipFormat);
    
    
    echo "your ip has been logged for nefarious porpoises";
    
    //echo '<br>';
    
?>

<div class="codebox">
<h3>Code:</h3>
<?php
highlight_file("ex037.php");
?>
</div>

</body>
</html>