Client Server Theory and Practice

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
poppo0
Forum Newbie
Posts: 1
Joined: Wed Feb 01, 2012 7:32 am

Client Server Theory and Practice

Post by poppo0 »

Hey guys,

This is my first post so congrats to me! =)

I have a little problem in trying to implement a client server. I'm trying to get a simple app on facebook. Obviously it's developed in php mostly.
I have a client side code that is supposed to connect to server. So the server has to be listening to accept connection... my problem is that I'm not sure exactly how to be doing this.
Ideal for me would be to make the server.php file run somehow, maybe by some command used in the client.php file? The server is handling a DB so there's more than a few code lines on it.

I'm stuck with this simple yet annoying issue.
Any code little code example for what I should actually do to solve this would be greatly appreciated.
Thanks a lot guys.
User avatar
Weiry
Forum Contributor
Posts: 323
Joined: Wed Sep 09, 2009 5:55 am
Location: Australia

Re: Client Server Theory and Practice

Post by Weiry »

I face this with a similar sort of scenario and i was pointed in the direction of using an existing protocol system such as XMPP or AMQP to deliver your messages.
There is code examples around for communicating on both protocols in PHP ( http://code.google.com/p/xmpphp/ || http://php.net/manual/en/book.amqp.php )
Regardless of which way you do it, you could run into problems where people *could* inject code directly into your system. So make sure to sanitize EVERYTHING!
Post Reply