Hi!
I'm looking for a small script that a person can enter their name and be in a PHP Webbased chat room. And just simply type and make their text write to a file. Does anyone know of any PHP Chat Scripts?
--andrew
Hi!
I'm looking for a small script that a person can enter their name and be in a PHP Webbased chat room. And just simply type and make their text write to a file. Does anyone know of any PHP Chat Scripts?
--andrew
doing this in pure php can't be done .. except that it can....
what im really saying is you can't do it like you could with a java applet... there is no php applet equiv... but there are other ways
no it can't:
php acts on the server... it prints out some stuff then dies... what it prints out is returned to the server... php can only do the whole page not parts of the page.... so no php can't do this....
a java applet is actually a little program that you download and run ... only its restricted to operating only inside the webpage... for saftey reasons.... but you need to have java on your computer... and the java plugin for your browser to be bale to run it... php only really acts on the server ... so it doesn't extend its reach to the client at all
yes it can:
ok well php doesn't have to just run on the server... you can write php applications independant of a webserver.. php has full socket support... so writing a chat client in php is doable... php also has access to graphics libraries like gtk... check out
http://gtk.php.net/
so you could write this.. but it wouldn't live in your webpage... they woudl have to download it and run it sperately
so you could have the same functionality as a java applet if the user had php installed on his/her computer... and had a php applet thingy installed on theri browser... im unaware of the existance of anything like this
yes it can:
ok well you could just have the page reload every few seconds... this would reload the chat window... and refresh any new text written... however this would not happen instantaniously.. so it may not be worth it...
yes it can:
you could use a frame... have that frame reaload every second... which would poll the server for any new messages... it would be returned by php not as html.. but as javascript data... then the rest of the webpage would look like the chat client.... every thime the press the [send message] button... it would post their message back to the server...
yes it can:
javascript image trick... you can tell javascript to load an image into a variable.... the image you tell it to load is really a php script.... that scripts sends some other information other than the image... js then uses what was returned to update the chat window.... does that make sense
any other ideas:
I haven't actuallly done this before so take my ideas with a grain of aslt... however i'd be happy to hear some other peoples opinions suggestions on this...
there are tons out there, I have written a few myself.
Having an small frame reload isnt really that big of a deal ( every 5 seconds, or when they click a refresh button or when they submit text )
Go to hostcripts.com and enter the php section.