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&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 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
19
Other forums
upgrade from 4.7 to ECC 6.0
Hi all,
we are going to do an upgrade from R/3 4.7 to ECC 6.0. I need to know if i can find som
Check premium expire
Hi,
I am making a simple file hosting site and want to check if users premium subscriptions h
ECC6 - Single sign-on
We are in the process of upgrading to ECC 6 which will support single sign on with user passwords al
$_POST
Hi, I have 2 seperate php files, and i want my $_POSt["fname"] To go into both of them, Fo
How to replace search button with link?
hi to everbody.
i have a search submit form and button like this :
<form id="f
DELETE rows based on content
I have a link in my rows
$bit="http://bit.ly/abcd";
$query = mysql_query("D
AJAX form submit
I recently built a form that submits data to my database with an ajax function that is called throug
Applet JTextField Size Problem
Hello,
I recently started making an applet to calculate certain values for airplanes. However
Logic question
im wondering what's the best method to do the above list:
it is for alliance @ MMORPG game
Converting RGB values to HEX
Code: <?PHP
$file_handle = fopen("colors/rgb.csv", "r");
wh