Jump to content

Load file in PHP


Graxeon

Recommended Posts

What do you get if you have a PHP page containing the following:

 

<?php

ini_set('display_errors', 'On');
error_reporting(E_ALL);

header("Content-Type: text/plain");
echo file_get_contents("http://www.zideo.nl/media.php?playzideo=6b3447616f467478&zideo=6c49575a6e6c633d");

?>

That gives this:

 

<?xml version="1.0" encoding="UTF-8"?>
<playlist version="1" xmlns="http://xspf.org/ns/0/">
<trackList>
<track>
<title>Zideo</title>
<location>http://storage.zideo.nl/24851/109759.m4v</location>
<duration>23:27</duration>
<info>http://www.zideo.nl?zideo=6c49575a6e6c633d&playzideo=6b3447616f467478</info>
<meta rel="type">m4v</meta>
<image>mediaswf.php?playzideo=6b3447616f467478&zideo=6c49575a6e6c633d&id=6c594b546e3135766e49453d&sharer=&.png</image>
</track>
<track>
<title>6b3447616f467478</title>
<location></location>
<meta rel="type"></meta>
</track>
</trackList>
</playlist>

That's odd...

 

Well, I got permission from the owner so here's the link:

 

http://www.zideo.nl/media.php?playzideo=6b3447616f467478&zideo=6c49575a6e6c633d

 

That page shouldn't have loading problems like my test page.

 

In that case use that link, instead of http://fr33.ulmb.com/gr/xml.xml

Well the XML are completely different!

even without the 60 second count down, http://fr33.ulmb.com/gr/xml.xml will give an invalid URL

ie

http://www.site.com/soccer-rainbow.m4v

 

http://www.zideo.nl/media.php?playzideo=6b3447616f467478&zideo=6c49575a6e6c633d is fine, but your need to update your code to suite!

I just made the second XML as a copy that I can replace values with. It's the same thing, just different values. It was because I couldn't give out the actual content without permission with the owner.

 

But again, I've done it with the real link. Here it is:

 

<?php
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'http://www.zideo.nl/media.php?playzideo=6b3447616f467478&zideo=6c49575a6e6c633d');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$myXML = curl_exec ($curl);
curl_close($curl);

$sxml = simplexml_load_string($myXML);
list($node) = $sxml->xpath('/playlist/trackList/track/location');
header("Location: $node");

?>

 

That gives a blank page: http://fr33.ulmb.com/gr/grzid2.php

What happens if you use the following file?

 

<?php
$sxml = new SimpleXMLElement('http://www.zideo.nl/media.php?playzideo=6b3447616f467478&zideo=6c49575a6e6c633d', NULL, TRUE);

header('Content-Type: application/xml');
echo $sxml->saveXML();
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.