Follow

Want your alternative? You can have one using a few small scripts and a web server.

You will need:
1. Basic PHP (or any server-side scripting language), JS, and HTML knowledge (or you can just vibecode the thing, or find an existing script somewhere online)
2. A webserver with PHP (or any other server-side language) enabled

Steps:

1. Get a webserver with PHP enabled. There are even free webhosts with PHP like Heliohost.
2. Create 4 files: a blank text file (name it "messages.txt" or something like that), a JS file, and two PHP files
3. The first PHP should just be for the chatbox. You need a message field and a name field along with a message box to display all the messages. Decorate it in anyway you want.
4. The second PHP file just appends the new message plus the username of who sent it into the messages.txt (or whatever you named it) file like this: (<name>: <message>)
5. In the JavaScript file, have three functions. One is a function that retrieves the contents of messages.txt via AJAX. The second one will retrieve the form data and submit it to the second PHP file via an AJAX POST request. The third function is the body.onload method and it repeatedly calls the first function through a setInterval (make it something like every 3 seconds).
6. ???
7. Instant community.

If you are more knowledgeable, you can try adding accounts, or having it appear on the side of every page on your site.

· · Web · 0 · 0 · 0
Sign in to participate in the conversation
Game Liberty Mastodon

Mainly gaming/nerd instance for people who value free speech. Everyone is welcome.