אשכול: פירוש לקוד
View Single Post
ישן 09-06-06, 22:17   # 1
DorWD
תודה על תרומתך.
 
DorWD's Avatar
 
מיני פרופיל
תאריך הצטרפות: Jan 2006
מיקום: עפולה
גיל: 32
הודעות: 2,259

DorWD לא מחובר  

פירוש לקוד

קיבלתי קוד שכותב לך לקובץ 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";
}
?>
תודה רבה!
__________________
מתכנת WEB