Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Client/Server software with php/javascript
Old 10-05-2010, 01:32 PM Client/Server software with php/javascript
RadGH's Avatar
Skilled Talker

Posts: 76
Name: Radley
Trades: 0
So I've done a bit of javascript and php programming and I'm fairly comfortable with both now. I've used AJAX a few times - but never really focused on it. I assume I'll need to use PHP/JS/AJAX for what I need to do.

I'm making a program, multiple users will be able to join one lobby in my program. I will need to allow each user to use different tools and create different objects, and send these to every user in that lobby.

It sounded easy at first, I would just send "Create new [object]" using AJAX to the web server. But I'm not sure where that should go... I don't know how you would send commands to each client with PHP.

In a perfect world, I would send a formatted array like so:
object Soldier {
int HP (300)
string Name ("Somebody")
}

But thinking about how PHP works, I would need to send this to a random page, which the client would read from constantly to find new data. Then I'd have to make a framework to interpret the commands.



Is there an easy way to accomplish this? And is there a term for what I am describing? I've done several google searches, and found some things about CGI and flow charts about how PHP is a server-side language. But nothing was what I was looking for.
RadGH is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 10-05-2010, 02:16 PM Re: Client/Server software with php/javascript
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
I assume I'll need to use PHP/JS/AJAX for what I need to do.
Nope. What you are talking about would require Java applets and servlets.

Quote:
I don't know how you would send commands to each client with PHP.
You can't. HTTP is a disconnected request/response protocol, only the client can initiate communication.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to Client/Server software with php/javascript
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.09811 seconds with 12 queries