Jump to content

prattmic

Members
  • Posts

    36
  • Joined

  • Last visited

    Never

Posts posted by prattmic

  1. Line 20 is the first line of my log and it is the oldest entry.  Well, since this is for a script that I distribute, the limit would vary meaning it would need some kind of code to add 19/20 to however high the limit is.
  2. I have text logs that I wish to auto-prune.  This is the header of the log:
    [code=php:0]<?php
    // DO NOT DELETE THIS
    include 'phpsimplechoose_config.php';
    //Below is where the verification takes place. Try to play around with it.
    if (!isset($_SERVER['PHP_AUTH_USER'])) {
    header('WWW-Authenticate: Basic realm="Please enter User/Password"');
    header('HTTP/1.0 401 Unauthorized');
    die;

    } else {

    if (($_SERVER['PHP_AUTH_USER'] !== $phpsc_username) || ($_SERVER['PHP_AUTH_PW'] !== $phpsc_password)) {
    header('WWW-Authenticate: Basic realm="Incorrect! Please try again."');
    header('HTTP/1.0 401 Unauthorized');
    die;
    }
    }
    // To delete log erase everything after the next line, but not the next line itself (Line 20 and down can be deleted)
    ?>[/code]

    The rest of the log consists of lines looking somewhat like this:
    [code]192.168.1.1: Thu August 10, 2006 11:23 : Choice 1.  thgfd  Choice 2.  hfghfghd  Choice 3.  fgdgfh  We say... hfghfghd <br />[/code]

    What I want to do is when the log reaches X number of the previous entries for it to delete some.  However, I want the header not to be deleted.

    If you need more info, just ask!

    Thanks in advance!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.