Embed Video Problem

Posted on 16th Feb 2014 by admin

Hey, thanks for looking!

File to be embedded:

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>
Embed code called by "embed.php?p=SOCCER&z=RAINBOW":

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);

?>
I didn't write it too well, though :/. I just get a blank page. Can someone please help me fix it?

Also, I'm trying to limit usage on this embed script. I want only specified inputs to work with the script.

For example, in this script I define exactly what is allowed and the rest give a blank page:

Code: <?php

if (isset($_GET['url'])) {

$converter = array('blankspot' => 'blanks',
'SOCCERRAINBOW' => 'futbolyllber',
'blankspothere' => 'blank');
$url = $_GET['url'];

if (isset($converter[$url])) {
//The actual execution code takes place here
header('Location: '.$node['url']);
exit;
}
}

?>
How can I do the same thing for the first script?


Thanks for helping

Other forums