Flat File Based Chat Help

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

pHp_n0ob
Forum Commoner
Posts: 35
Joined: Mon Jul 09, 2012 7:30 am
Location: India

Re: Flat File Based Chat Help

Post by pHp_n0ob »

twinedev wrote:Browsing to http://topz.iwebs.ws/priyanka/Love.txt (the content of the file you are trying to display backwards) shows:
<--- WWW.WAPFTP.BIZ --->
TestingTesting2Testing3
Going to the test site you gave saying it isn't reversing it is giving:
TestingTesting2Testing3<--- WWW.WAPFTP.BIZ --->
So the "TestingTesting2Testing3" line (which is the second line in the text file) IS displaying before the "<--- WWW.WAPFTP.BIZ --->" line (which is the first line in the text file).

So it is working, you just are not putting each item on it's own line, you need to do $msg."\n" when writing the data to the file. Also you need add some <BR> or whatever you want to use between each line like:

Code: Select all

$output = $line."<br>\n".$output;


BTW, since this will be for a "chat", I would assume that this page will update often so people can see the latest replies. Say you have 10 people in chat, and you do one update per second, that is 600 page calls PER MINUTE, do you really need two different sites tracking all 600 calls per minute? (on top of the is 600 times a minute the text file will read... 600 times per minute that the apache log files will have to update... this is why HTTP based chat is so wasteful)

-Greg
I didnot understood...please clearify :-(
User avatar
twinedev
Forum Regular
Posts: 984
Joined: Tue Sep 28, 2010 11:41 am
Location: Columbus, Ohio

Re: Flat File Based Chat Help

Post by twinedev »

which part?
pHp_n0ob
Forum Commoner
Posts: 35
Joined: Mon Jul 09, 2012 7:30 am
Location: India

Re: Flat File Based Chat Help

Post by pHp_n0ob »

twinedev wrote:BTW, since this will be for a "chat", I would assume that this page will update often so people can see the latest replies. Say you have 10 people in chat, and you do one update per second, that is 600 page calls PER MINUTE, do you really need two different sites tracking all 600 calls per minute? (on top of the is 600 times a minute the text file will read... 600 times per minute that the apache log files will have to update... this is why HTTP based chat is so wasteful)

-Greg
This one
Post Reply