Hey, my first time here...hope I put in the correct forum xD
Ok so:
I have this XML file that I'm trying to embed:
<playlist version="1">
<trackList>
<track>
<title>SOCCER - RAINBOW</title>
<location>http://www.site.com/soccer-rainbow.m4v</location>
<duration>23:27</duration>
<info>
http://www.site.com/info.php?video=RAINBOW&title=SOCCER
</info>
<meta rel="type">m4v</meta>
<image>
images.php?title=SOCCER&video=RAINBOW
</image>
</track>
<track>
<title>SOCCER</title>
<location/>
<meta rel="type"/>
</track>
</trackList>
</playlist>
I'm trying to grab the URL within the "location" tags.
That XML file is generated by calling with "media.php?p=RAINBOW&z=SOCCER"
So here are my attempts. I keep getting blank pages on them.
<?php
$title = $_GET['p'];
$video = $_GET['z'];
$url2='http://www.site.com/media.php?title='.$title.'&video='.$video;
$sxml = simplexml_load_file($url2);
list($node) = $sxml->xpath('/playlist/tracklist/track/location');
header('Location: '.$node);
?>
2nd attempt:
<?php
$title = $_GET['p'];
$video = $_GET['z'];
$url='http://www.site.com/media.php?title='.$title . '&video='.$video ;
$string = file_get_contents($url);
$sxml = new SimpleXmlElement($string);
$node = $sxml->playlist/trackList/track/location;
header('Location: '.$node);
?>
Can someone please help me with this?