Using PHP script to fill in XML

Posted by Yaaqov on Stack Overflow See other posts from Stack Overflow or by Yaaqov
Published on 2010-04-08T16:29:58Z Indexed on 2010/04/08 16:33 UTC
Read the original article Hit count: 348

Filed under:
|
|

Hi - we are all familiar with "embedding" PHP scripts in HTML pages to do tasks like displaying form results, but how can that be done in a way that displays XML?

For example, if I wrote:

<? xml version='1.0' ?>
<Responses>
  <?php
        $body = $_GET['Body'];
        $fromPh = $_GET['From'];
        echo
        echo "<Msg>Your number is: $fromPh, and you typed: $body.</Msg>"
  ?>
</Response>

I get a message that states "parse error, unexpected T_STRING on line 1". Any help or tutorials would be appreciated.

© Stack Overflow or respective owner

Related posts about php

Related posts about Xml