I am new to PHP and have to create a program that whilst running allows usert to browse a site and add the current page to a linear text, whilst at the same time creating a contents menu linked to bookmarks of each of the pages just added to the linear text.

I was unable to find what I was looking for by searching (possibly inexperience of using the site)

Anyway I was wondering if anyone has any chunks of code that could be of use for any of the above problem.

Thanks

Recommended Answers

All 4 Replies

what is linear text? can you give an example/illustration?

one continuous file. storing the contents of several web pages in one file.

one continuous file. storing the contents of several web pages in one file.

Yikes, sure seems suited to a database application....

But if you want to stay with text files, you could write files to the server, one for content and one for the bookmarks. I'm not sure how you track the user, generally they would have to login and that would mean you'd have a database handy! I suppose you could grab the sessionid and use that as a temp file name. Then use fopen with the a flag to add content to the end of the file.

fopen("/home/mydir/" . $file_name . ".txt", "a");

you'd want to stick some "marker" in there to delimit the entries, probably something unique that you could explode the file into an array with.

You might want to whack the file at the end of the session to keep your drive from filling up!

HTH!

Do you want to track this info with software on a web server or with software on the user's computer? If on a web server then php should be able to (as long as pages browsed are on that particular webserver). If on the user's computer then you need to use a different language (like c++ or maybe visual basic).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.