Jump to content

Hello. I'm relatively new at coding but I know my way around HTML and css. I'm trying to design a website that has a chatroom for us to talk with and I have absolutely no idea what I am doing. I searched the internet for so long to find a tutorial or something. Anyone have any help? I'm tired of deleting code over and over again.

Link to comment
https://linustechtips.com/topic/1053884-htmlcssjsphp-chatting/
Share on other sites

Link to post
Share on other sites

1 hour ago, Deviama said:

I'm using W3schools to help me, but I am still clueless.

don't waste your time
you can use this (scroll down to the "embed" section)
https://tlk.io/

In the options you can even give it a custom css file to change the colors and such.

Much simpler, no waste of money, no waste of time :) 

~New~  BoomBerryPi project !  ~New~


new build log : http://linustechtips.com/main/topic/533392-build-log-the-scrap-simulator-x/?p=7078757 (5 screen flight sim for 620$ CAD)LTT Web Challenge is back ! go here  :  http://linustechtips.com/main/topic/448184-ltt-web-challenge-3-v21/#entry601004

Link to comment
https://linustechtips.com/topic/1053884-htmlcssjsphp-chatting/#findComment-12474687
Share on other sites

Link to post
Share on other sites

You can start by separating your problem in smaller problems

 

You want to implement a chat system, where several people can chat between them.

So ...

* you need a way to differentiate between users, to know which person said what.

* you need to store messages as they come from various users participating in the chat

* you need to display the most recent messages on the screen

* you need to periodically update the screen to show recent messages (if some other user posted a message)

* you need a way for users to send messages.

 

 

With HTML and CSS you only deal with the part that shows the messages to the user, and displays a way for users to send messages to the server, let's say a form with a text area to input the message, a text area or a hidden field which contains the username that will send the message and a button that when pressed will submit the form.

The messages can be shown in a DIV on the page, or in a separate iframe, or in a canvas object if you're designing this using HTML 5  

With Javascript you can do stuff like period update of the text on the page or submitting messages, without reloading the pages

With a scripting language like PHP on the server, you can receive messages from each user and save them on the server in a database or a simple text file.

 

If this is too much for you or you don't feel like learning so much, you can search for an existing solution (a bunch of scripts or html pages) which you would then incorporate into your website.

Here's an example of such a script : https://www.hotscripts.com/listing/blab-lite/

You need to have PHP on your server and MySQL database to store the messages into. Detailed instructions on how to set it up are included in the downloads.

 

 

 

 

 

Link to comment
https://linustechtips.com/topic/1053884-htmlcssjsphp-chatting/#findComment-12476060
Share on other sites

Link to post
Share on other sites

PHP and AJAX real-time chat is always a bit of a pain.  Have you considered NodeJS?  It's a lot different from PHP but if you power through the initial learning curve it isn't that hard.  I'm recommending NodeJS because of Socket.io.  It's a real-time JavaScript library that does pretty much all the hard work for you, making it fairly easy to create a chat application.

Link to comment
https://linustechtips.com/topic/1053884-htmlcssjsphp-chatting/#findComment-12477052
Share on other sites

Link to post
Share on other sites

On 4/12/2019 at 11:24 PM, Qyndryx said:

PHP and AJAX real-time chat is always a bit of a pain.  Have you considered NodeJS?  It's a lot different from PHP but if you power through the initial learning curve it isn't that hard.  I'm recommending NodeJS because of Socket.io.  It's a real-time JavaScript library that does pretty much all the hard work for you, making it fairly easy to create a chat application.

man doesn't even know js yet, babysteps xd

Link to comment
https://linustechtips.com/topic/1053884-htmlcssjsphp-chatting/#findComment-12484353
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×