PHP generated hotspot issue

  • Once again I need an extra set of eyes to look over something before I go insane.

    I have a php script that generates XML for krpano.
    The relevant portion being.....


    $query = "SELECT * FROM `vthotspot` WHERE `parent` = '$scene' ";
    $result = mysql_query($query);
    if($result) {
    while($row = mysql_fetch_array($result, MYSQL_ASSOC))
    {
    $index = $row['index'];
    $name = $row['name'];
    $ath = $row['spotath'];
    $atv = $row['spotatv'];

    echo "<hotspot name=\"hs$index\" style=\"icongeneral\"";
    echo " ath=\"$ath\"";
    echo " atv=\"$atv\"";
    echo " zoom=\"false\"";
    echo " scale=\"0.5\"";
    echo " />";
    }
    }

    When the script is run the output visually looks just perfect, but none of the hotspots are rendered and an error is returned ERROR: parsing parameters failed - TypeError: Error #1034.
    I even tried copying one of the hotspots from the output XML and pasting it in the script, so it was not dynamically generated, and the hard-code shows up just fine!
    So there has to be something with the PHP. But yet lines 2 and 3 of the XML below are exactly the same - except that line two is hard-coded and line 3 is dynamic.?!?!?!

    WTF?!

    Here is the relevant output of the script. The first two lines are the hard coded ( and hotspots that are rendering ), the remaining three are dynamically generated and not rendering.

    <hotspot name="editSpot" style="dragablehotspot" ath="0" atv="0" zoom="false" scale="0.5"/>
    <hotspot name="hs93" style="icongeneral" ath="37.0" atv="-22.0" zoom="false" scale="0.5"/>
    <hotspot name="hs93" style="icongeneral" ath="37.0" atv="-22.0" zoom="false" scale="0.5"/>
    <hotspot name="hs104" style="icongeneral" ath="-115.4" atv="-5.6" zoom="false" scale="0.5"/>
    <hotspot name="hs103" style="icongeneral" ath="34.7" atv="-19.9" zoom="false" scale="0.5"/>

  • add a space before />

    This is part of my code:

  • Zephyr,

    Thanks for the reply and suggestion!

    But I'm still having issues.
    What has me really miffed is that the hard coded and dynamic versions of a hotspot, both having seemingly identical XML output will and will-not, respectively, render.
    It's almost as if the XML is getting parsed before the PHP has completely worked it's magic? *confused*

  • Nah, that ain't possible unless you use the flush function

    It's probably something in your style.
    I suggest that you need to post an actually link to your issue.

    Most likely thinking about the possible issues relating to php is keeping you from seeing the obvious somewhere else.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!