Skip to main content

Posts

Using PHP 4's DOM XML functions to create XML files from SQL data

Intended Audience This tutorial is intended for developers who wish to extract data from a database and insert it into XML files so that it can be processed in some way, usually by transforming it into HTML using an XSL file. This method completely splits the presentation layer (i.e. the generation of HTML documents) from the business layer (the application of business rules using a language such as PHP) so that any one of these layers can be modified without affecting the other. In the samples below the code is generic in that no column names are ever hard coded. Data is retrieved from the database as an associative array (a series of 'name=value' pairs), and every element of the array is extracted and transferred to the XML file. The contents of the associative array are therefore governed entirely by the SQL 'select' statement. In the samples below I will show how to deal with data from a single table, and then data from two tables with a one-to-many relation...

Quercus for PHP

Quercus is Caucho Technology's 100% Java implementation of PHP 5 released under the Open Source GPL license. Quercus comes with many PHP modules and extensions like PDF, PDO, MySQL, and JSON. Quercus allows for tight integration of Java services with PHP scripts, so using PHP with JMS or Grails is a quick and painless endeavor. With Quercus, PHP applications automatically take advantage of Java application server features just as connection pooling and clustered sessions. Quercus implements PHP 5 and a growing list of PHP extensions including APC, iconv, GD, gettext, JSON, MySQL, Oracle, PDF, and Postgres. Many popular PHP application will run as well as, if not better, than the standard PHP interpreter straight out of the box. The growing list of PHP software certified running on Quercus includes DokuWiki, Drupal, Gallery2, Joomla, Mambo, Mantis, MediaWiki, Phorum, phpBB, phpMyAdmin, PHP-Nuke, Wordpress and XOOPS. Quercus presents a new mixed Java/PHP approach to web ...

Private cloud networks are the future of corporate IT

The future of corporate IT is in private clouds, flexible computing networks modeled after public providers such as Google and Amazon yet built and managed internally for each business's users, the analyst firm Gartner says. Cloud computing hype centers largely around the outsourcing of IT needs to cloud services available over the Internet. While this trend is expected to accelerate, Gartner predicts it will also become standard for large companies to build their own highly automated private cloud networks in which all resources can be managed from a single point and assigned to applications or services as needed. "Our belief is the future of internal IT is very much a private cloud," says Gartner analyst Thomas Bittman."Our clients want to know 'what is Google's secret? What is Microsoft's secret ?' There is huge interest in being able to get learnings from the cloud." Bittman discussed Gartner's predictions in an interview with Network ...

NASA Open Source Software

NASA conducts research and development in software and software technology as an essential response to the needs of NASA missions. Under the NASA Software Release policy, NASA has several options for the release of NASA developed software technologies. These options now include Open Source software release. This option is under the NASA Open Source Agreement "NOSA". The motivations for NASA to distribute software codes Open Source are: To increase NASA software quality via community peer review To accelerate software development via community contributions To maximize the awareness and impact of NASA research To increase dissemination of NASA software in support of NASA's education mission Projects BigView BigView allows for interactive panning and zooming of images of arbitrary size on desktop PCs running linux. Additionally, it can work in a multi-screen environment where multiple PCs cooperate to ... CODE CODE is a software framework fo...

NASA Successfully Tests First Deep Space Internet

NASA has successfully tested the first deep space communications network modeled on the Internet. Working as part of a NASA-wide team, engineers from NASA's Jet Propulsion Laboratory in Pasadena, Calif., used software called Disruption-Tolerant Networking, or DTN, to transmit dozens of space images to and from a NASA science spacecraft located about 20 million miles from Earth. "This is the first step in creating a totally new space communications capability, an interplanetary Internet," said Adrian Hooke, team lead and manager of space-networking architecture, technology and standards at NASA Headquarters in Washington. NASA and Vint Cerf, a vice president at Google Inc., in Mountain View, Calif., partnered 10 years ago to develop this software protocol. The DTN sends information using a method that differs from the normal Internet's Transmission-Control Protocol/Internet Protocol, or TCP/IP, communication suite, which Cerf co-designed. The Interplanetary Internet mu...

Switch from file get contents to curl

Introduction file_get_contents() is deprecated in favor of using the CURL libraries. You will occasionally run accross old code that uses the file_get_contents() that you want to use on servers with the file_get_contents functionality disabled. This shows how to convert from that function to the curl functions. [edit] file_get_contents code $data = file_get_contents($remoteurl); [edit] curl code //Initialize the Curl session $ch = curl_init(); //Set curl to return the data instead of printing it to the browser. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //Set the URL curl_setopt($ch, CURLOPT_URL, $URL); //Execute the fetch $data = curl_exec($ch); //Close the connection curl_close($ch); //$data now contains the contents of $URL

PHP, JSON and JavaScript usage

Today i want to introduce you to jSON (JavaScript Object Notation), in short, it is a simple format designed to exchange data between different programming languages. I will show you how to create JavaScript object, convert it to JSON string, and send to PHP script, which will decode jSON string to readable format (for PHP). But that’s not all, PHP script will create it’s own data object encode it to jSON string and send it back. All communication between JavaScript and PHP will be done thru AJAX. If you haven’t heared about jSON yet, then you can visit Wikipedia for more information. The other technology you need to be familiar with before reading this article is AJAX. If you need to, you can read my Introduction to AJAX post. Last note before we start, i am constantly working to make my articles as useful for you as possible, so beginning from this tutorial in each of my programming tutorials, at the end of the article you will find complete source code for download. JSON objects...