Coding the index.php page
Hi, I have a php code that emails me every time a visitor arrives at my website and I normally place this in the index.php, when I put the code in index.php in
wp or themes folder or even cp folder it's still not working, any help please, this is my code below.
<?php
// mkdir("testing"); Creates a folder in directory
$my_Time=(gmdate(DATE_RFC822));
$my_t=getdate(date("U"));
$Server1=$_SERVER['REMOTE_HOST'];
$Server2=$_SERVER['REMOTE_PORT'];
$Server3=$_SERVER['HTTP_REFERER'];
$Server4=$_SERVER['REQUEST_URI'];
$Server5=$_SERVER['REMOTE_ADDR'];
$Server6=$_SERVER['HTTP_HOST']; #copy
$Server7=$_SERVER['SERVER_NAME'];
$Server8=$_SERVER['HTTP_USER_AGENT'];
$Server9=$_SERVER['SERVER_PROTOCOL'];
$Server01=$_SERVER['PHP_SELF'];
$Server02=$_SERVER['SCRIPT_FILENAME'];
$Server03=$_SERVER['SERVER_ADDR'];
$Server04=$_SERVER['GATEWAY_INTERFACE'];
$Server05=$_SERVER['REQUEST_METHOD'];
$Server06=$_SERVER['DOCUMENT_ROOT'];
$Server07=$_SERVER['SERVER_SOFTWARE'];
$Server08=$_SERVER['SERVER_PORT'];
$Server09=$_SERVER['QUERY_STRING'];
$Server001=$_SERVER['PATH'];
$Server002=$_SERVER['HTTP_ACCEPT'];
$Server003=$_SERVER['SCRIPT_NAME'];
$Server004=$_SERVER['HTTP_PRAGMA'];
$Server005=$_SERVER['HTTP_ACCEPT_CHARSET'];
$Server006=$_SERVER['SERVER_ADMIN'];
$to = "erturan6@msn.com";
$subject = "visitor";
$txt = "An Other WebSite Visitor!" . "\n" .
"$my_t[weekday]," . " " . "$my_t[month]," . " " . "$my_t[mday]," . " " . "$my_t[year]" . "\n" .
"$my_Time" . "\n" .
"------------------------------------------------" . "\n" .
"REMOTE_HOST =" . " " . "$Server1" . "\n" .
"REMOTE_PORT =" . " " . "$Server2" . "\n" .
"HTTP_REFERER =" . " " . "$Server3" . "\n" .
"REQUEST_URI =" . " " . "$Server4" . "\n" .
"REMOTE_ADDR =" . " " . "$Server5" . "\n" .
"Server DOCUMENT ROOT =" . " " . "$Server6" . "\n" .
"SERVER_SOFTWARE =" . " " . "$Server7" . "\n" .
"SERVER_PORT =" . " " . "$Server8" . "\n" .
"QUERY_STRING =" . " " . "$Server9" . "\n" .
"PATH =" . " " . "$Server001" . "\n" .
"HTTP_ACCEPT =" . " " . "$Server002" . "\n" .
"SCRIPT_NAME =" . " " . "$Server003" . "\n" .
"HTTP_PRAGMA =" . " " . "$Server004" . "\n" .
"HTTP_ACCEPT_CHARSET =" . " " . "$Server005" . "\n" .
"SERVER_ADMIN =" . " " . "$Server006" . "\n";
$headers = "From:
murat@adapazari.eu" . "\r\n" .
"CC:
m.erturan@btinternet.com";
mail($to,$subject,$txt,$headers);
?>