reading text generated by javascript

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

Post Reply
77ball
Forum Newbie
Posts: 2
Joined: Mon Jan 19, 2009 3:55 pm

reading text generated by javascript

Post by 77ball »

I know it's possible for other applications like flash or javascript to read data generated by a php page. But is it possible for php to read data generated by javascript? I know about xmlhttp.send, but this is too slow for what I want. They need to be communicating around 30 times a second.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: reading text generated by javascript

Post by requinix »

Not really. Look into using Flash to keep an open connection between the client and your server. There can be a JavaScript "interface" so it doesn't all have to be Flash driven.

Don't forget that you're limited by the client's upload speed (and your download speed too of course). 1KB thirty times a second is 30KB which most people can do, but 10KB "packets" are harder. Doesn't sound like that will be an issue though.
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Re: reading text generated by javascript

Post by Burrito »

also check out silverlight. It's quite nice for doing things like you need.
77ball
Forum Newbie
Posts: 2
Joined: Mon Jan 19, 2009 3:55 pm

Re: reading text generated by javascript

Post by 77ball »

Each transmission to the server will be about 50-75 bytes. Very small. The data being received from the server will likely be about 3-4X that.

In Flash, I know about the XMLSockets, but unfortunately I'm using a shared server and not allowed to use a server socket. I will look into Silverlight, can I get a free trial anywhere?

Thanks for the help everyone. Does anybody know of any other game creation tools like Flash that are capable of setting up a connection between two hosts?
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Re: reading text generated by javascript

Post by Burrito »

77ball wrote:...I will look into Silverlight, can I get a free trial anywhere?...
Silverlight is free but you're going to need an IDE to compile your package and visual studio is NOT free. There might be a free alternative to VS, but I don't know of one.
Post Reply