Hello
Ok...so I'm trying to embed the URL within the "location" tags of this XML file:
Code:
<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>
That XML file is generated by "media.php?p=RAINBOW&z=SOCCER"
So, for my PHP script I tried this:
PHP Code:
<?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);
?>
And I also tried this but neither worked because they gave blank pages:
PHP Code:
<?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);
?>
Help please?
|