execute iplog.php on click of links

i am logging visitors IP by the following code below

$iplogfile = 'ips.txt';
    $ipaddress = $_SERVER['REMOTE_ADDR'];
        $webpage = $_SERVER['SCRIPT_NAME'];
            $timestamp = date('d/m/Y h:i:s');
            $browser = $_SERVER['HTTP_USER_AGENT'];
        $fp = fopen($iplogfile, 'a+');
        chmod($iplogfile, 0777);
    fwrite($fp, '['.$timestamp.']: '.$ipaddress.' '.$webpage.' '.$browser. "rn");
fclose($fp);

but i want it to be execute only when user clicks on this particular links

<a href="tel:+1 (000) 000-0000" class="btn-blue btn-red">Book Now</a>
<a href="tel:+1 (111) 111-1111" class="btn-blue btn-red">Call Now</a>

can someone help me out here? i cannot figure out how to acheive it 🙁

Thanks alot for your help and input.