Search Results

Search found 2 results on 1 pages for 'celebritarian'.

Page 1/1 | 1 

  • PHP: How do I loop through every XML file in a directory?

    - by celebritarian
    Hi! I'm building a simple application. It's a user interface to an online order system. Basically, the system is going to work like this: Other companies upload their purchase orders to our FTP server. These orders are simple XML files (containing things like customer data, address information, ordered products and the quantities…) I've built a simple user interface in HTML5, jQuery and CSS — all powered by PHP. PHP reads the content of an order (using the built-in features of SimpleXML) and displays it on the web page. So, it's a web app, supposed to always be running in a browser at the office. The PHP app will display the content of all orders. Every fifteen minutes or so, the app will check for new orders. How do I loop through all XML files in a directory? Right now, my app is able to read the content of a single XML file, and display it in a nice way on the page. My current code looks like this: // pick a random order that I know exists in the Order directory: $xml_file = file_get_contents("Order/6366246.xml",FILE_TEXT); $xml = new SimpleXMLElement($xml_file); // start echo basic order information, like order number: echo $xml->OrderHead->ShopPO; // more information about the order and the customer goes here… echo "<ul>"; // loop through each order line, and echo all quantities and products: foreach ($xml->OrderLines->OrderLine as $orderline) { echo "<tr>\n". "<li>".$orderline->Quantity." st.</li>\n". "<li>".$orderline->SKU."</li>\n"; } echo "</ul>"; // more information about delivery options, address information etc. goes here… So, that's my code. Pretty simple. It only needs to do one thing — print out the content of all order files on the screen — so me and my colleagues can see the order, confirm it and deliver it. That's it. But right now — as you can see — I'm selecting one single order at a time, located in the Order directory. But how do I loop through the entire Order directory, and read aand display the content of each order (like above)? I'm stuck. I don't really know how you get all (xml) files in a directory and then do something with the files (like reading them and echo out the data, like I want to). -- I'd really appreciate some help. I'm not very experienced with PHP/server-side programming, so if you could help me out here I'd be very grateful. Thanks a lot in advance! // Björn (celebritarian at me dot com)

    Read the article

  • Getting the most out of a Mac mini as a media center

    - by celebritarian
    Hello! I own an old Mac mini from 2006 (maybe early 2007). It's got an Intel Core Solo 32-bits CPU and 512 MB RAM. 160 GB HDD. The GPU is an integrated chip… Currently, my Mini is sitting under my LCD TV (720p). It's plugged in via a DVI to HDMI cable. It's currently running Leopard. And unfortunately, Snow Leopard can't be installed on a device with less than 1 GB of RAM… So, my Mac mini isn't exactly powerful. Also, it's slow and Mac OS X is not a pleasant experience on my Mini right now. It feels slow and heavy. I want to use my Mac mini as a media center/player. I want to be able to play video files in 720p (H.264, Matroska/MOV files). So basically, playing high-def videos is all I want to do with my Mini. What OS should I install? Stick to OS X? Optimize for video playback? Or should I install another OS — like Win XP, Ubuntu or any other Linux dist? Then, will my Mini be able to play 720p videos smoothly, even though the CPU and GPU aren't that powerful and with the limit of 512 MB of RAM? Appreciate all help. Thanks in advance!

    Read the article

1