Merhaba php ile iletişim formundan gelen konu ve mesajı fwrite ile dosya olarak yazdırıyorum. Kullanıcıdan ıp adresi ve tarayıcı bilgisi (User-Agent? nasıl alabilirim?

<?php
$txt = "mesaj.txt";
if (isset($_POST['konu']) && isset($_POST['mesaj'])) {
header('Location:succesfull.php');
$fh = fopen($txt, 'a');
$txt=$_POST['konu'].' - '.$_POST['mesaj'];
fwrite($fh,$txt."\n");
fclose($fh);
}
?>