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.

¿Fue útil la respuesta?

 Imprimir éste Artículo

Leer también

Setup extra mailserver for newsletters

Posted by dream_th, 06-29-2008, 12:22 PMHi, I have problems to express with my english but i...

Get stats out of Cs, Bf2, Quake and others

Posted by ExobiT, 09-23-2008, 12:14 AMHi, if i have some gameservers with quake, cs, css bf2, and...

remote reboot, how?

Posted by selbach, 05-06-2007, 07:59 AMnow, ive been looking at this but cant find out how to do...

constantly blocked on pop3

Posted by Calibaba, 09-14-2007, 05:50 PMI just setup a new pop account in Outlook 2007 and...

.htaccess redirect all pages to https://www

Posted by LJ Host, 07-17-2007, 01:50 PMHi guys, I'm not to good with htaccess so I need your...