|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Wondering if there is an easier way to do this...
Hullo, all.
I am working on coding a site that will list (in a table) dates of performances of a play like thing, and the roles of the play. Let me give a brief example below: ------12/01/03 | 12/02/03 Role 1 | Role 2 | Role 3 | Sorry for the crude example. Anyway, people would be able to come to this site to see if someone had taken the role they wanted on the date they wished to do it. If not, they would be able to fill out a form, saying what part they would like, and when they can do it. This data would be transfered to the site updaters. Here is where my problem comes in. I am currently designing the table using include()'s linked to a text file (ex: a1.txt, a2.txt; b1.txt, b2.txt). Each table cell receives it's own text file, usually just one word within the file. I have been trying to create a new page, which the site updaters will log into. They will fill out a small form, choosing which table cell to update (ex: a5), and the text they wish to change that file to (ex: Joe Mills, showing that Joe has agreed to act the certain role on the certain date). This information is passed on to the next page using the GET method. The next page uses the fwrite() function to overwrite the previous contents of the file chosen, and if successfull, prints a simple message ("Cell A5 changed to Joe Mills"). Unfortunately, this has not been working currently. I should state right now that I am very much a beginner at PHP (just two weeks of frantically working my way through a PHP book in preparation for this site). Now, given what I've said so far, it might seem that this would be more appropriate in the PHP Coding section, but for reasons I am about to state, I felt it would be better here. I have read that using fwrite() is very dangerous. Should I be going about this task a different way (database, maybe)? Also, if you think that fwrite() is safe enough in my case, is there a better way to do what I'm doing? I was thinking maybe just one .txt file with a PHP array in it, but as fwrite completely overwrites the file (or writes to the beginning or end, which I don't think would work), I wasn't sure if this would be possible. Also, would it be possible to change more than one file by going through the form, with multiple text boxes? Would this get to be too big for GET to handle? Your thoughts and ideas, please. Also, I'd be very grateful if you could be complete in your explanations. Don't assume I know anything. Thanks much! Gingivere Beginning PHP Coder |
|
#2
|
|||
|
|||
|
RE: Wondering if there is an easier way to do this...
I suggest using a database.
http://www.mysql.com/ |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Programming Theory > Wondering if there is an easier way to do this... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|