使用xml和php的mini-tweeter项目

In a project for school I need to send xml data to the client that logs in(using php). I`m on the server side so I will need to answer requests(using post) and act accordingly. This project is a kind of a mini-tweeter.

For example:

<xml version="...">
   <response>log-in</response>
   <parameters>
      <error>error_id</error_id> 
      <session>adsvcv</session>
   </parameters>

where error_id is 0,1,2 - 0 begin success, 1 -invalid user, 2- invalid pass

the client sends a request like this:

<xml version="...">
    <action>log-in</action>
    <parameters>
        <username>Tommy</username>
        <pass>abcd</pass>
    </parameters>

And I dont know where to start, never having used XML until now.
So I would kindly ask you to guide me in the right direction. Thanks for your time in advance!

I would start by googling for XML parsing in PHP. There are some functions that make it really easy.

After that, you can start designing the interaction between the parts of the program with something called a "state diagram." It doesn't need to be fancy. It'll just help you keep organized. You can start by drawing a tall box for each part of your program and then lines between the different parts to show how information gets passed between them. You can even fix bugs in this stage.

After that it should be a bit easier to know what functions you need, and what information they'll use. :)

Good luck!

PHP has build-in xml engine. Check the examples!

Please read about websockets