how to build a simple Chat room

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Smackie
Forum Contributor
Posts: 302
Joined: Sat Jan 29, 2005 2:33 pm

how to build a simple Chat room

Post by Smackie »

i want to learn how to make a simple little php chat room with banning control and admin control can anyone give me a good tutorial website for this or even help me with making some of the scripts or something please...????
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

I think you'd normally use Java Applets or similar for this not PHP
Smackie
Forum Contributor
Posts: 302
Joined: Sat Jan 29, 2005 2:33 pm

Post by Smackie »

i seen alot of php chat rooms and i would like to kinda put one of my own together.. i would like to use java but right now i wanna make a php chat room...
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post by markl999 »

Do you mean a discussion board/forum like this one or a live interactive chat?
User avatar
n00b Saibot
DevNet Resident
Posts: 1452
Joined: Fri Dec 24, 2004 2:59 am
Location: Lucknow, UP, India
Contact:

Post by n00b Saibot »

try to look into phpMyChat for further info on this matter.
Smackie
Forum Contributor
Posts: 302
Joined: Sat Jan 29, 2005 2:33 pm

Post by Smackie »

see i tried that chat room it was crappy as hell.. and it doesnt have all the features i want to have on my chatrooms i know i can get it and add to it but theres other stuff i really like to do as well... like i would like it to set at the bottom of my site where all my users can chat with everyone while playing my game im building... and i would like to have it when the user signs in the user gets login on the chat room as well..... i just want a good tutorial for this...
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

hi

Post by s.dot »

Hi, I have experimented with many PHP chatrooms for my website. I've tried running an infinite while loop to maintain an http connection so the page would never refresh (causing it to blink). This worked for a few minutes, but inevitably it uses up too much server RAM and is very inadequate. Then I wrote a program that used hidden iframes to post to a page, that was appended to with a javascript. This works, but it required PHP sessions (that I'm not too familiar with) and my sessions always timed out. The best chat program that I've found BY FAR is an IRC based chat from http://www.everywherechat.com . It is the perfect chat, and it's free. I wouldn't use anything else. All it requires is you posting a simple java applet code on an HTML page.
Smackie
Forum Contributor
Posts: 302
Joined: Sat Jan 29, 2005 2:33 pm

Post by Smackie »

Like i said before i dont want to use a chat room thats already built i would like to make my own because i cannot find a chat room to fit my needs so thats why i want to build one on my own all i need is a good tutorial that will give me enough idea's to build one...
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Smackie
Forum Contributor
Posts: 302
Joined: Sat Jan 29, 2005 2:33 pm

Post by Smackie »

not much help there but i think im just going just start throwing codes everywhere and try coming up with a good idea and make one up myself thank for your guys help anyways....

Smackie
User avatar
Trenchant
Forum Contributor
Posts: 291
Joined: Mon Nov 29, 2004 6:04 pm
Location: Web Dummy IS

Post by Trenchant »

if you ever do come back...

Look in the "Code Snippets" section. There was a post on there a while ago for a PHP chat program backended by IRC. It was actually a bot in that post but it would be a good place to get started.

Using php for a bot is just asking to use a ton of bandwidth however.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

well here's a good tutorial that shows you how to build one that you can modify yourself.

http://code.jenseng.com/jenChat/
Smackie
Forum Contributor
Posts: 302
Joined: Sat Jan 29, 2005 2:33 pm

Post by Smackie »

thank you scrotaye it looks useful for what i want to do.....
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Post by shiznatix »

..why dont u just use some extreamly simple php based mesage board and just throw in a metta refresh tag for refresh every half second because that is all the jenChat does :roll: . hell u can even use txt files and leave out all the javascript. if you want a real live feed script you have to use either somthing irc based or use java
Smackie
Forum Contributor
Posts: 302
Joined: Sat Jan 29, 2005 2:33 pm

Post by Smackie »

well for 1 like i said i want to build my own all im going to do is look at jenChat and see how its setup and stuff.. for 2 i want a php chat room and it will refresh every 20 seconds... and for 3 i dont like irc programs they aint my thing to use and on java part im going try and make one later on after i learn Java......
Post Reply