Hello everyone,
i have created a visitor-logging-script that saves the visited pages into a table. The table looks like this:
CREATE TABLE xyz(
id bigint NOT NULL auto_increment,
visitor_timestamp varchar(50),
visitor_stunde varchar(5),
visitor_minute varchar(5),
visitor_sekunde varchar(5),
visitor_tag varchar(5),
visitor_monat varchar(5),
visitor_jahr varchar(14),
visitor_ip varchar(25),
visitor_webpage varchar(120),
visitor_referer varchar(120),
PRIMARY KEY (id),
KEY visitor_ip(visitor_ip)
);
I would like to display the pages/directories the user visited in a tree-like style, chronologically ordered - just like this:
12:30:22 pm |-/index.php
12:30:23 pm ....|-/dowsoftware
12:30:30 pm ....|-/weblinks
12:30:32 pm ........|-/php
12:31:00 pm ....|-/tips
.
.
.
And not only just like this with a while-loop that simply prints out the database-table:
12:30:22 pm /index.php
12:30:23 pm /dowsoftware
12:30:30 pm /weblinks
12:30:32 pm /weblinks/php
12:31:00 pm /tips
.
.
Now, all I save in my database ist some time related data, the referer and the page the user requested (made with $PHP_SELF).
So far so good (?)
But I totaly failed building a tree just like I described above. I know that its a recursive job and not quite easy - I failed finding articles or code snippets dealing with this issue.
Is anyone able to help me how to sort this out? (Well explained ) Theory and code snippets are very welcome!
Thank you,
Jens