oli22 Posted October 10, 2011 Share Posted October 10, 2011 What php method is good for getting file from a .xml sheet ? Quote Link to comment https://forums.phpfreaks.com/topic/248818-php-method-to-retrieve-file-from-xml/ Share on other sites More sharing options...
ManiacDan Posted October 10, 2011 Share Posted October 10, 2011 You will have to clarify your question. XML files are already files. What do you have, and what do you want? Quote Link to comment https://forums.phpfreaks.com/topic/248818-php-method-to-retrieve-file-from-xml/#findComment-1277840 Share on other sites More sharing options...
jcbones Posted October 10, 2011 Share Posted October 10, 2011 Are you asking how to parse a XML file? If so, simplexml should do it. Quote Link to comment https://forums.phpfreaks.com/topic/248818-php-method-to-retrieve-file-from-xml/#findComment-1277945 Share on other sites More sharing options...
oli22 Posted October 12, 2011 Author Share Posted October 12, 2011 What i need to find is storing video embed codes(not only youtube) on a xml to retrieve them via php to play videos from list. It's not as easy as i thought, or is it? Quote Link to comment https://forums.phpfreaks.com/topic/248818-php-method-to-retrieve-file-from-xml/#findComment-1278787 Share on other sites More sharing options...
ManiacDan Posted October 12, 2011 Share Posted October 12, 2011 Use simplexml, like was stated above. It's not as easy as you think, you'll have to actually use quite a bit of PHP to get it to do what you want, but there are simplexml tutorials out there. Quote Link to comment https://forums.phpfreaks.com/topic/248818-php-method-to-retrieve-file-from-xml/#findComment-1278788 Share on other sites More sharing options...
oli22 Posted October 13, 2011 Author Share Posted October 13, 2011 Ok i will read up on simplexml, which i know the basic to only use simple text. But i have found an easier way. Instead of getting the embed directly from xml i am using php includes with embeds in them, no harcore xml parsing required. From videoThumbs.php i use: <a href="playPage.php?movieTitle=funnySketch" > Then use a 'GET' on playPage.php <?php $playVideo = $_GET['movieTitle']; ?> Use $playVideo variable to embed with an include <?php include("includesFolder/$playVideo.php"); ?> Thats my basic quick working solution, i have to finish this thing fast. Next i will use 'simplexml' to show title and video description, no heavy duty parsing required for simple text... Its might be a little odd to have data coming from 2 places,1)the xml 2)includesFolder MAy be i will learn something else on my way there... By the way, i was thinking: Isn't it better to have an indivudual html page for each video&description for SEO? Any avice about tecnical my solution??? Quote Link to comment https://forums.phpfreaks.com/topic/248818-php-method-to-retrieve-file-from-xml/#findComment-1278856 Share on other sites More sharing options...
oli22 Posted October 13, 2011 Author Share Posted October 13, 2011 Even better maybe would be to 'GET' somesort of id from videoThumbs.php so even the php include is writen in the xml, tha way ALL the info is in the xml tree. <?php include("includesFolder/$playVideo.php"); ?> would be <?php include("includesFolder/variable from xml.php"); ?> Thats the rest of my question i suppose Any avice about tecnical my solution??? Quote Link to comment https://forums.phpfreaks.com/topic/248818-php-method-to-retrieve-file-from-xml/#findComment-1278859 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.