קיבלתי קוד שכותב לך לקובץ ip.html את האייפי של מישהו שנכנס לאתר
אני אכתוב אותו פה ואני אשמח שתציינו לי מה כל קטע של הקוד אומר
הנה הוא:
PHP קוד:
<?
$txt = ' index <br> ';
?>
<?php
$filename = 'ip.html';
$somecontent = getenv('REMOTE_ADDR' ) ;
if (is_writable($filename)) {
if (!$handle = fopen($filename, 'a')) {
echo "Cannot open file ";
exit;
}
// Write $somecontent to our opened file.
if (fwrite($handle, $somecontent) === FALSE) {
echo "Cannot write to file ()";
exit;
}
echo "";
fclose($handle);
} else {
echo "The file is not writable";
}
$somecontent = $txt ;
if (is_writable($filename)) {
if (!$handle = fopen($filename, 'a')) {
echo "Cannot open file ";
exit;
}
if (fwrite($handle, $somecontent) === FALSE) {
echo "Cannot write to file ()";
exit;
}
echo "";
fclose($handle);
} else {
echo "The file is not writable";
}
?>
תודה רבה!