Re: Flat File Based Chat Help
Posted: Sat Nov 03, 2012 2:51 pm
I didnot understood...please clearifytwinedev wrote:Browsing to http://topz.iwebs.ws/priyanka/Love.txt (the content of the file you are trying to display backwards) shows:
Going to the test site you gave saying it isn't reversing it is giving:<--- WWW.WAPFTP.BIZ --->
TestingTesting2Testing3So 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).TestingTesting2Testing3<--- WWW.WAPFTP.BIZ --->
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