apache“s access.log parsing

Sure, this is just a little thing, but i liked to show the apaches long lined access.log in a better readable way.

Just opening the access.log file with PHP and parsing line per line….


$file = "/path/to/access_log";
@$fp = fopen($file,"r");

if (!$fp) {
    echo $file ."not existent!\n";
}
else {
    while (!feof($fp)) {
        $zeile = fgets($fp, 230);
        $buffer  = explode(" ", $zeile);

        $datum = substr($buffer[3], 1);        

        echo "IP-Address: ".$buffer[0]."\n";
        echo "Date: ".$datum."\n";
        echo "DeliveredPage: ".$buffer[6]."\n";
        echo "Backlink: ".$buffer[10]."\n";
        echo "User-Agent: ".$buffer[11]."\n";
        echo "

\n"; } } @fclose($fp);

toggle checkboxes listed in groups

I have just needed a toggling function made with javascript for checkboxes wich are grouped in lists. It should look like a hierarchical tree-like structure. When I check the box of my first tree-category, all related subcategories automatically must getting checked too.

I have used the prototype framework for other functionalities on the website, so I preferred to take use of it for helping me by developing this. Prototype framework comes with form functions like getInputs(), but this function gets completely all input fields of a form and not from a specified list, so this did not help me in this situation.

This is a silhouetted visualization of my grouped checkboxes:

  1. [x] Category 1
    1. [x] product 1
    2. [x] product 2
    3. [x] product 3
  2. [ ] Category 2
    1. [ ] product 1
    2. [ ] product 2
    3. [ ] product 3

Continue reading toggle checkboxes listed in groups