1) goto the page
2) PHP reads a file that contains a number, by default the number will be 1
3) PHP reads the db file and retrieve's the line number based on what was in step 2
4) PHP echos the line's contents
5) PHP edits the file that step 2 read from and adds 1 to the number.
This system is not working properly. (note, I am using php4, take this in mind when helping me)
Here is "get.php":
Code: Select all
<?php
// Get current line number
$filename = "l.txt";
$handle1 = fopen($filename, "w+");
$linenum = file($filename); // Get line num
$file = file($filename);
// Read the DB
$filename = "db.php";
$handle2 = fopen($filename, "r");
$lines = file($filename); //$lines is an array
// $file = fread($handle, filesize($filename));
echo htmlentities($lines[$linenum]);
fclose($handle2);
// Change the line # for next request
$file = $file + 1;
fwrite($handle1, $file);
echo htmlentities($lines[$linenum]);
fclose($handle1);
?>Code: Select all
1Code: Select all
<?php echo "Trying to peak? Attempt logged."; exit; ?>
Account1 Password1
Account2 Password2
Account3 Password3
Account4 Password4
Account5 Password5
Account6 Password6
Account7 Password7
Account8 Password8It gives me these errors:
Code: Select all
Warning: Illegal offset type in /usr/export/www/hosting/abc/stuff/get.php on line 13
Fatal error: Unsupported operand types in /usr/export/www/hosting/abc/stuff/get.php on line 17