Hello everyone, I just found a web site running a really cool script but I can't figure out how they do it. The script is located at http://www.smalltime.com/Anonymous Can someone help me figure out how it is coded? I'm "OK" with PHP but could be a lot better. Know what I mean? Thanks for your help! Brandon
When someone writes a message. Get the contents of message.txt and show it to the one who submitted the new message, then replace the old message with the new message. As simple as that.
Setup a database with one table "MESSAGES", which contains one entry with one field "message". Upon submission of a message: 1. Get the (only) entry from the database and save in a variable 2. Take the submitted message and save it over the only entry in the database 3. Display the variable on the screen For statistics or tracking you could alternatively have 3 fields in the DB table "messages" : "id" (auto-increment), "message", "date". Upon submission of a message: 1. Get the last entry (most recent date, or highest id) and save in a var 2. Save the submitted message in the DB 3. Display the var from step 1 This way you save all messages that have ever been submitted. This can grow pretty big, pretty fast if the site is popular