easy php chat

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

Post Reply
ampersand
Forum Commoner
Posts: 54
Joined: Thu Nov 28, 2002 2:00 am
Location: Norway

easy php chat

Post by ampersand »

I need to make an easy php chat? how can I start or go for tutorials on a chat ?
I don't wanna use a database but a text file..

Best Regards
R.A.
RohanJM
Forum Newbie
Posts: 4
Joined: Sun May 25, 2003 12:21 pm
Location: India

Post by RohanJM »

Im not sure if this will help but if you are a flash developer it will.... there are a lot of chat tutorials on chat's made with Flash 'n' PHP at http://www.flashkit.com
[]InTeR[]
Forum Regular
Posts: 416
Joined: Thu Apr 24, 2003 6:51 am
Location: The Netherlands

Post by []InTeR[] »

Chat with php is simple,

You need 3 things.

A frameset with a 'output' and 'input' part.

The input part is go'ing to insert each line in a database.

The output part is go'ing to readout every line from the database.
In a never-ending while.....
Flush a lot......

Ready is your chat. (in theory).
ampersand
Forum Commoner
Posts: 54
Joined: Thu Nov 28, 2002 2:00 am
Location: Norway

Post by ampersand »

Thanks. I made a php last night, but there is a little problem!
How can I make emails and url to hyperlink when submitted to the chat window ?
sleepingdanny
Forum Newbie
Posts: 12
Joined: Thu Mar 20, 2003 4:27 am
Location: Israel

Post by sleepingdanny »

You can try using: str_replace(" "," ") for this.
Or you can use: ereg_replace :P
ampersand
Forum Commoner
Posts: 54
Joined: Thu Nov 28, 2002 2:00 am
Location: Norway

Post by ampersand »

I'm using ereg_replace for emoticons but I'm not sure how to write it so it converts url's and mails to hyperlinks :? could you help me please ? :)
ampersand
Forum Commoner
Posts: 54
Joined: Thu Nov 28, 2002 2:00 am
Location: Norway

Post by ampersand »

This chat is not using a database, is that a problem when I want url to become hyperlinks ?
User avatar
mikusan
Forum Contributor
Posts: 247
Joined: Thu May 01, 2003 1:48 pm

Post by mikusan »

It depends on how exactly are you using php, you are not going to get away with an echo('http://www.link.com');
instead (i don't know how you are using php) you would have to
$string = '<a href="http://www.link.com">Linkname</a>';
echo($string);

This is perfect if you are building a modular site, if instead you use *.html files with some <? //phpcode here ?> you would simply put the link in the html but wrap it around some kinda php function and a LOT of <? ?>...
ampersand
Forum Commoner
Posts: 54
Joined: Thu Nov 28, 2002 2:00 am
Location: Norway

Post by ampersand »

actually its rather a shoutbox, you can look at it here:

Shoutbox
Post Reply