סקריפט PHP נגד עמודים בחינם

טופס יצירת קשר חינם סקריפט PHP
תסריט ספר אורחים PHP בחינם

זֶה סקריפט php נגד עמודים בחינם משתמש fopen(), fread(), fwrite(), ו fclose() פונקציות לקריאה ולעדכון של קובץ טקסט המאחסן את הערך הנוכחי של המונה. יש ליצור את קובץ הטקסט "counter.txt" ולהגדיר תחילה לאפס לפני שניתן יהיה להשתמש בסקריפט זה.

<?php
  // Open the text file
  $file = fopen("counter.txt", "r");
  // Read the current value of the counter
  $count = fread($file, filesize("counter.txt"));
  // Close the file
  fclose($file);
  // Increment the counter
  $count = $count + 1;
  // Open the file for writing
  $file = fopen("counter.txt", "w");
  // Write the new value to the file
  fwrite($file, $count);
  // Close the file
  fclose($file);
?>
<html>
  <head>
    <title>Website counter</title>
<style>
.counter {
  text-align: center;
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #f5f5f5;
  padding: 20px;
  border-radius: 5px;
  box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}

.counter p {
  font-size: 20px;
  margin-bottom: 5px;
  color: #333;
}

.counter span {
  font-size: 36px;
  font-weight: bold;
  color: #4CAF50;
}

.counter:hover {
  background-color: #e5e5e5;
  cursor: pointer;
}
</style>
  </head>
<body>	
<div class="counter">
  <p>Visitors:</p>
  <span>232323<?php echo $count; ?></span><br />
  <u><a href="https://php.org" title="PHP tutorials">Powered by PHP.org</a></u>
</div>
</body>
</html>
טופס יצירת קשר חינם סקריפט PHP
תסריט ספר אורחים PHP בחינם

הישאר מעודכן לגבי PHP!

אנחנו לא שולחים ספאם!

en English
X
גלול למעלה