I am using the PHP library SimpleXML to pull data from an existing XML file on my site and add it to an HTML page.
The following is a snippet from the XML, which is at https://media.vivastaff.com/designs/94341/xml-3042-1.xml:
<DTilt>
<frontSide imagePath="94341/20130510150043_ACXZ0001C-01.png"></frontSide>
<backSide imagePath="94341/20130510150043_ACXZ0001C-02.png"></backSide>
</DTilt>
The following is the PHP code I'm using to pull the XML data:
<?php
$eid = 94341;
$pid = 3042;
$ver = 1;
$xmlPath = 'https://media.vivastaff.com/designs/' . $eid . '/xml-' . $pid . '-' . $ver . '.xml';
?>
<div id="cardFront"><img src="https://media.vivastaff.com/designs/<?php echo simplexml_load_file("$xmlPath")->DTilt->frontSide->imagePath; ?>"</div>
It is not pulling the data from the XML file I have and is returning nothing. I've tried many variations of this, but nothing seems to work. I may not be specifying "imagePath" correctly, but not sure were to go from here. What am I doing wrong on this?