37 users online (1 members and 36 guests)  


  Results 1 to 8 of 8
  1. #1
    Zaire's Avatar
    Senior Member

    Status
    Offline
    Join Date
    Mar 2001
    Location
    Hamburg, NY
    Posts
    312

    Someone hava problem with XML and PHP?

    I was lookin' at a XML tutorial, trin' to understan how it worked, and I came accross something interesteing.

    XML files use <?....?> to open with, and php also uses this, and it's called php's "short-style tag"

    Well, if you use those for php, it doesn't know if you redeclaring the XML file or not, so you have to use

    <?php
    ....
    ?>

    For your php code.. That is the normal tag anywayz

    Hope it helps.. i think it was derek

  2. #2
    Derek's Avatar
    Be Yourself

    Status
    Offline
    Join Date
    Aug 2001
    Location
    St. George, Utah, USA
    Posts
    466

    it was me...

    but unfortunetly I read that in my php book, I copied the exact code block on from my book with the <?xml ?> things (not short tag for php), and it still didn't work. Maybe it's Foxserve? I dunno thx for tryin I'll fcheck into that I'd never thought maybe it was foxserve.

  3. #3
    Zaire's Avatar
    Senior Member

    Status
    Offline
    Join Date
    Mar 2001
    Location
    Hamburg, NY
    Posts
    312
    So you had somethin' like this

    <?xml version="1.0"?>
    <article>
    <title><?php echo($title); ?></title>
    <body><?php echo($body); ?></body
    </article>

  4. #4
    Derek's Avatar
    Be Yourself

    Status
    Offline
    Join Date
    Aug 2001
    Location
    St. George, Utah, USA
    Posts
    466

    yup

    it won't take <?xml version="1.0" ?> at all or anything like that...and anything just plain <? ?> is registered as php.

  5. #5
    Zaire's Avatar
    Senior Member

    Status
    Offline
    Join Date
    Mar 2001
    Location
    Hamburg, NY
    Posts
    312
    That's not what I ment..

    The xml start stays like that, but any php you use in the xml, has to be normal tag style <?php ... ?>

    Get it?

  6. #6
    Derek's Avatar
    Be Yourself

    Status
    Offline
    Join Date
    Aug 2001
    Location
    St. George, Utah, USA
    Posts
    466

    no that's what what I mean ;) haha

    that's what I was saying...in a confusing style I guess all I know is anything with <xml> at the start of it is rejected by the .php. With mine anyways. How's it with yorus? It doesn't matter what's on the rest of the page the first line is rejected..the line with the <xml> on it. and I do use the <?php; ?> style on it.

  7. #7
    Zaire's Avatar
    Senior Member

    Status
    Offline
    Join Date
    Mar 2001
    Location
    Hamburg, NY
    Posts
    312
    Any chance you tried namin' it .xml ?

  8. #8
    Derek's Avatar
    Be Yourself

    Status
    Offline
    Join Date
    Aug 2001
    Location
    St. George, Utah, USA
    Posts
    466

    not yet...

    but it's way late so I don't want to get into anything I'm just gonna go to bed but no I haven't, but would php work with the .xml extension?



Tags for this Thread