PDA

View Full Version : display flat file db results?


Evoir
10-11-2001, 09:06 PM
I am runing a script that allows people to refer a page to a friend. It collects the information in a flat text file like this:

date|refering url|senders email|recievers email|

I'd like to create a little web page that displays this information, as well as allowing me to clear the info with a button. Is this somewhat simple? I have no idea how I'd do this.... anybody able to explain how this would work?

It could be cgi or php or whatever it needs to be :)

:)

sheila
10-11-2001, 09:19 PM
What are you saying...you want a web page that displays this info for YOU, the administrator? Like, some time after people have come and gone from your website, and the data is lying around in the file, and you'd like to view it, you want like an administrative page where you can view the info in the file?

Is that what you're saying?

Certainly it is possible with either CGI or with PHP. CGI means you could write it in Perl, Python, C++, Tcl or any of a number of other languages.

Of course, I would always plug Python, but...

From a standpoint of being able to get a lot of widely available help here at FutureQuest, PHP is probably a good way to go. There are a lot of tutorials even online that will show you how to open a file and display the contents on a webpage, I'd imagine. ???

Evoir
10-11-2001, 09:34 PM
yeah, it is an administrative thing....not for the public. Just me.

Maybe it will become my first php script. :)
Anyone have Any pointers?

I want to be able to view the flatfile db, export the emails and empty the db. :)

Mandi
10-11-2001, 09:52 PM
Check the php/mySQL forum for a recent thread started by me, for a few leads on using php/flatfile DB together. I haven't yet implemented the program I asked about . . . I've been beating back my vBulletin disk space (see related thread, same forum LOL . . .)

sheila
10-11-2001, 10:25 PM
Well, a good place to start for getting your feet wet, is the PHP tutorial at PHP.net (http://www.php.net/tut.php) .

This will walk you through a "Hello World" program, which is always the first step in learning a programming language! ;)

On the links page at PHP.net (http://www.php.net/links.php), if you scroll down, there is a list of tutorial sites. Although, I glanced through the links, and there don't seem to be a lot of "beginner" ones IMO.

Dev Shed (http://www.devshed.com/Server_Side/PHP) has a lot of PHP tutorials. Here is a very beginner one (http://www.devshed.com/Server_Side/PHP/Introduction/page1.html). (True, it says PHP3 instead of PHP4, but for the beginner stuff I'd bet there's no difference at all. I think this is one of the tutorials I worked through when I dabbled in PHP quite some time back, and I found it to be a pretty good one.)

Here's one about file commands. (http://www.kill-9.dk/ttl_php_fopen.php)

And, more PHP tutorial links:
http://www.justphukit.com/php-tutorials.php
http://www.devshed.com/Server_Side/PHP
http://www.hotscripts.com/PHP/Tips_and_Tutorials/

What I'd recommend you do:

(1) Make a "Hello, World!" page.
(2) Work through two or three tutorials, until you feel like you don't want to do those any more.
(3) Learn how to use PHP to open a file and display the contents of a file in a web page.

That should get you part of the way towards the script you're thinking of doing. By the time you can do #3, you'll be ready to start thinking about how you can display only part of the stuff in the file, and how you can format it to look nice and so on.

Well, I'm sure you'll keep us posted as to how it is going! Good Luck!