3-line PHP chat

Posted by Looie, 01-15-2008, 03:28 PM
Just an idea I had http://www.ehwtf.com/stuffz/chat

Posted by Dolbz, 01-15-2008, 03:54 PM
incredibly insecure but pretty cool

Posted by liam_tmt7, 01-15-2008, 06:39 PM
yeah insecure put still pretty nice if you were just using it for messing around. I like it....lol Liam

Posted by csparks, 01-15-2008, 08:39 PM
it could be used as a base, but anything else, like said insecure. Are you new to php? If so, make sure you check out all information regarding securing scripts.

Posted by Fizzadar, 01-15-2008, 08:44 PM
it's not working any more

Posted by ThatScriptGuy, 01-15-2008, 11:46 PM
Until you get the file opened at the same time on two, three, fifteen machines, and lose data...

Posted by Czaries, 01-15-2008, 11:54 PM
Anytime you have frequent updates from multiple users, you are going to run into concurrency issues. You need to add file locking at the very least to prevent this.

Posted by luki, 01-16-2008, 02:00 AM
Pretty "nasty" IMO, but as far as concurrency, this is actually safe on a local file system. It turns out, when a file is opened with the "append" flag, the file cursor is moved to the end of the file prior to each write, so as long as you write the entire chat line in one call, you are guaranteed that it will not be interrupted.

Posted by Looie, 01-16-2008, 12:25 PM
I don't intend to use it, I just wondered if it would work, and it does... kinda

Posted by schoeps, 01-16-2008, 12:56 PM
It works, but I prolly wouldnt use it

Posted by Harzem, 01-16-2008, 01:17 PM
And the idea of using an iframe makes it a little more secure Nice idea. Otherwise, would ruin it.

Posted by Xeentech, 01-16-2008, 04:08 PM
Well since the mime type is text/plain, and php is in it's horrible default of escaping the crap out of anything and everything it is actually securer than I expected, and sadly securer than some things I've seen in production.. If it's a 1 cpu machine it's unlikely that two end users would write to the file at the same time..

Posted by Looie, 01-17-2008, 01:24 PM
Can someone please explain to me why it's so insecure? All it's doing is writing data to a txt file...

Posted by ThatScriptGuy, 01-17-2008, 01:40 PM
But the chances of it happening increase dramatically as more users use it at once.

Помог ли вам данный ответ?

 Распечатать статью

Также читают

SSL Certificate works for folders?

Posted by Energizer Bunny, 01-13-2008, 06:10 AMHi, Say i have domain zzzzz.com and have some...

JaguarPC reselling program?

Posted by Snoopy, 09-28-2001, 11:22 PMHi, I am looking for a good reseller program....

Disk IO performance

Posted by diskio, 03-26-2008, 08:03 PMFrom the Disk I/O performance is it better 1) to have main...

Hosting Related Press Releases

Posted by SoftWareRevue, 04-29-2009, 10:30 AM Post your press release for the WHT community...

Apache/MySQL/PHP Issue - PHP not loading.

Posted by Darkfire001, 06-28-2008, 01:36 PMHi Guys, Any and all help is appreciated. I've got...