forward slash in closing tag mixing up code

  • Hi
    I need to generate some xml-code with php/mysql. This does not work correctly because the code is mixed up by misinterpreting the forward slashes.
    When I try for example

    PHP
    <?php echo '<scene name="hallo">
    <preview url="bla.blu" />
    <view hlookat="0" />
    <hotspot name="hs1" />
    <hotspot name="hs2" />
    </scene>';
    ?>

    the source code looks correctly

    Code
    <scene name="hallo">
    <preview url="bla.blu" />
    <view hlookat="0" />
    <hotspot name="hs1" />
    <hotspot name="hs2" />
    </scene>

    but the generated source code is automatically adding cosing tags to the end, so all my code is garbage and does not work correctly anymore:

    Code
    <scene name="hallo">
    <preview url="bla.blu">
    <view hlookat="0">
    <hotspot name="hs1">
    <hotspot name="hs2">
    </hotspot></hotspot></view></preview></scene>

    is there a way to prevent this?

  • hi,
    as I know in php the forward slash is not an escape character but only the back slash, and your link is also treating the backslash only.
    anyway, the result is the same.
    when echoing
    /> the result is >
    when echoing
    //> the result is >
    when echoing
    \/> the result is \="">

  • but I thought, maybe, the problem is on another point. I'll describe a little bit more exactly what I'm trying:
    I generate some hotspots with php/mysql
    All hotspots appear as they should. Then I tried to add hover-tooltips to every hotspot. For testing I only put a word as tooltip, the same for all hotspots.
    For the first hotspot in the list, the tooltip is showing up correctly. But for all others it's not working.
    When hovering any other hotspot, the tooltip appears for a short moment, then disappears although I#m still hovering. Then, hovering on another hotspot brings no result. If I go back to the first working hotspot, all is ok again. After this, the same as before: when hovering on another hotspot, the tooltip appearing for a short moment, then disappears, and so on...

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!