SunQuest
           Programming Theory
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesProgramming Theory

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old September 27th, 2003, 03:32 AM
Gingivere Gingivere is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 3 Gingivere User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #2  
Old September 28th, 2003, 03:45 PM
mugane mugane is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Charlottesville, VA USA
Posts: 425 mugane User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via AIM to mugane Send a message via Yahoo to mugane
RE: Wondering if there is an easier way to do this...

I suggest using a database.

http://www.mysql.com/

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesProgramming Theory > Wondering if there is an easier way to do this...


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway