Load file in PHP


Posted on 16th Feb 2014 07:03 pm by admin

I have 2 files. The first is a PHP generated XML file that's dependent by 2 inputs. The second is a PHP file that grabs the content of the XML file.

So I have this:

Did you know?Explore Trending and Topic pages for more stories like this.
site.com/xml.php?p=RAINBOW&z=SOCCER
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&amp;title=SOCCER</info>
<meta rel="type">m4v</meta>
<image>images.php?title=SOCCER&amp;video=RAINBOW</image>
</track>

<track>
<title>SOCCER</title>
<location/>
<meta rel="type"/>
</track>
</trackList>
</playlist>
I want to grab the contents of the "location" tags.

So, I have this now:

media.php?p=RAINBOW&z=SOCCER
Code: $title = $_GET['p'];
$video = $_GET['z'];

$myXML = 'www.site.com/xml.php?p=' .$title. '&z='.$video;

$sxml = simplexml_load_string($myXML);
list($node) = $sxml->xpath('/playlist/trackList/track/location');
header("Location: $node");
But I get the error "Fatal error: Call to a member function xpath() on a non-object on line 9".

What variables did I mess up? Can someone help me fix it, please?
No comments posted yet

Your Answer:

Login to answer
83 Like 19 Dislike
Previous forums Next forums
Other forums

Access website from only 1 computer...?
One of my customers wants his website to only be accessed by people in which they bought the website

mysql UNION | warning mysql_fetch_array !!
Code: <?php
$i = 0;
$query1="SELECT * FROM `products` WHERE `div

Auto fill in input value based on User_ID
Hello,

I'm looking form some input on the following problem.

User loads page ->

Help =( !! Upload Pics [PHP script]
Hello
I need help with a php script [MULTIPLE UPLOAD IMAGES] , where I want to add a feature (wat

confused between ' ' and " "
there is a php i set:
$begin_date_query = mysql_query( "SELECT SUBDATE(due_date, INTERVAL $d

why does my session end?
my connect.php starts the session just so you know
i can navigate arround my site fine except whe

my two tables
table1 : col1 = topicid , col2 = topic

table2 : col1 = sentid, col2 = sentence

Cod

parse error
Parse error: syntax error, unexpected '[', expecting ')' in /Users/admin/Sites/phptest/array.php on

Mass activity scheduling
Hi experts,

Im facing some problems to deal with mass activity jobs.
When I run some

gmdate() - want 1 hr before time
Hi,
I am using php gmdate().
Now I am entering all dates in my dbase using gmdate("Y-m-d

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash