<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.0.4" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>Java Web Hosting, Subdomain, Vps Hosting, Cpanel, Programming Blog</title>
	<link>http://www.tomcatjavahosting.com</link>
	<description>Weblog about finding and using Tomcat Java web host</description>
	<pubDate>Tue, 22 Jan 2008 02:08:39 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.4</generator>
	<language>en</language>
			<item>
		<title>416 CHAPTER 13   CASE STUDY: USING PHP  (Web site translator)</title>
		<link>http://www.tomcatjavahosting.com/tomcat/416-chapter-13-case-study-using-php-web-site-translator/</link>
		<comments>http://www.tomcatjavahosting.com/tomcat/416-chapter-13-case-study-using-php-web-site-translator/#comments</comments>
		<pubDate>Tue, 22 Jan 2008 02:08:39 +0000</pubDate>
		<dc:creator>humphreyblogart</dc:creator>
		
	<category>Tomcat</category>
		<guid isPermaLink="false">http://www.tomcatjavahosting.com/tomcat/416-chapter-13-case-study-using-php-web-site-translator/</guid>
		<description><![CDATA[416 CHAPTER 13   CASE STUDY: USING PHP FOR AN XML APPLICATION   Summary   In this chapter, I worked through an application that uses PHP, MySQL, XML, and XSLT to  display and manage weather content. The application stores all of the data within a MySQL  database. The application retrieves [...]]]></description>
			<content:encoded><![CDATA[<p>416 CHAPTER 13   CASE STUDY: USING PHP FOR AN XML APPLICATION   Summary   In this chapter, I worked through an application that uses PHP, MySQL, XML, and XSLT to  display and manage weather content. The application stores all of the data within a MySQL  database. The application retrieves the relevant database records with PHP 5. It uses the new  PHP 5 DomDocument object to generate the XML document. The structure of the generated  XML documents is flexible enough to cope with several different scenarios.   In order to display the XML content within the application, I used XSLT stylesheet transformations to generate XHTML. You saw how to use XSLT variables and include conditional  logic in the stylesheets.   This chapter wraps up the book. I hope you ve enjoyed reading about XML and that  you ve expanded your knowledge. XML is a flexible approach to building both client- and  server-side web applications, and I hope the contents of this book will make you as enthusiastic about XML as I am!  <br />If you are looking for affordable and reliable webhost to host and run your business application visit our <a href="http://domain.smartwebsitehosting.net">ftp web hosting</a> services.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.tomcatjavahosting.com/tomcat/416-chapter-13-case-study-using-php-web-site-translator/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>CHAPTER 13   CASE STUDY: USING PHP FOR  (1 on 1 web hosting)</title>
		<link>http://www.tomcatjavahosting.com/tomcat/chapter-13-case-study-using-php-for-1-on-1-web-hosting/</link>
		<comments>http://www.tomcatjavahosting.com/tomcat/chapter-13-case-study-using-php-for-1-on-1-web-hosting/#comments</comments>
		<pubDate>Mon, 21 Jan 2008 16:09:44 +0000</pubDate>
		<dc:creator>humphreyblogart</dc:creator>
		
	<category>Tomcat</category>
		<guid isPermaLink="false">http://www.tomcatjavahosting.com/tomcat/chapter-13-case-study-using-php-for-1-on-1-web-hosting/</guid>
		<description><![CDATA[CHAPTER 13   CASE STUDY: USING PHP FOR AN XML APPLICATION 415   addweather.php   The final part of the application processes the weather details entered by users and adds the  content to the database. As I mentioned earlier, the database stores all values in Celsius  degrees. The page addweather.php [...]]]></description>
			<content:encoded><![CDATA[<p>CHAPTER 13   CASE STUDY: USING PHP FOR AN XML APPLICATION 415   addweather.php   The final part of the application processes the weather details entered by users and adds the  content to the database. As I mentioned earlier, the database stores all values in Celsius  degrees. The page addweather.php starts with a conversion function that converts Fahrenheit  temperatures to Celsius:   <?php  function alterTemp($temperature, $current) {  if ($current=='C') {  $newtemp = $temperature;  } else {   $newtemp = ((($temperature -32) * 5) / 9); } return $newtemp;   }   It then includes the weather.php file and collects the values from the weather details form:   include_once 'weather.php'; $city = $_POST['city']; $min = $_POST['min']; $max = $_POST['max']; $weather = $_POST['weather']; $temptype = $_POST['temptype'];   The page needs to make sure that there are valid minimum and maximum temperatures  before entering the information into the database:   if (is_numeric($min) &#038;&#038; is_numeric($max)) {   $sql = 'INSERT INTO weather (weatherCityID, weatherDate, weatherMin, .  weatherMax, weatherWeatherTypeID) VALUES (' . $city . ',' . time() . ',' . .  alterTemp($min, $temptype) . ', ' . alterTemp($max, $temptype) . ','.  . $weather . ')';   }  else {   $sql = 'SELECT (1+1)';  }  mysql_query($sql) or die(mysql_error() . $sql);   Finally, it needs to redirect back to the weather page for the current city:   header('Location: index.php?city=' . $city);  ?>   Figure 13-7 earlier in the book shows how the completed application appears when viewing the weather for a city.    <br />You need excellent and relaible webhost company to host your web applications? Then pay a visit to <a href="http://www.g5websitehosting.com">Inexpensive Web Hosting</a> services.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.tomcatjavahosting.com/tomcat/chapter-13-case-study-using-php-for-1-on-1-web-hosting/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Web host server - 414 CHAPTER 13   CASE STUDY: USING PHP</title>
		<link>http://www.tomcatjavahosting.com/tomcat/web-host-server-414-chapter-13-case-study-using-php/</link>
		<comments>http://www.tomcatjavahosting.com/tomcat/web-host-server-414-chapter-13-case-study-using-php/#comments</comments>
		<pubDate>Mon, 21 Jan 2008 00:22:56 +0000</pubDate>
		<dc:creator>humphreyblogart</dc:creator>
		
	<category>Tomcat</category>
		<guid isPermaLink="false">http://www.tomcatjavahosting.com/tomcat/web-host-server-414-chapter-13-case-study-using-php/</guid>
		<description><![CDATA[414 CHAPTER 13   CASE STUDY: USING PHP FOR AN XML APPLICATION



       The stylesheet also includes a form so users can add a new weather report:
Add a new entry:
  The form needs to pass the current city id, so the application can store the value in the [...]]]></description>
			<content:encoded><![CDATA[<p>414 CHAPTER 13   CASE STUDY: USING PHP FOR AN XML APPLICATION
<td><xsl:value-of select="$MaxF"/></td>
</tr>
</table>
<p>  </xsl:otherwise>  </xsl:choose>   The stylesheet also includes a form so users can add a new weather report:<br />
<hr/>Add a new entry:<br/><br />
<form action="addweather.php" method="POST">  The form needs to pass the current city id, so the application can store the value in the  database:   <xsl:text disable-output-escaping="yes">   &lt;input type=&#8221;hidden&#8221; name=&#8221;city&#8221; value=&#8221;</xsl:text>  <xsl:value-of select="weather/city/@id"/>  <xsl:text disable-output-escaping="yes">&#8221; /&gt; </xsl:text>   The rest of the form provides appropriate inputs as well as a drop-down list showing the  different weather types:   Temperature is in:<br />
<select name="temptype"> <option value="C">Celsius</option> <option value="F">Fahrenheit</option>   </select>
<p><br/> Weather:<br />
<select name="weather">   <xsl:for-each select="weather/weathertypes/type">  <xsl:text disable-output-escaping="yes">   &lt;option value=&#8221;</xsl:text>  <xsl:value-of select="@id"/>  <xsl:text disable-output-escaping="yes">&#8220;&gt;</xsl:text>  <xsl:value-of select="."/>  <xsl:text disable-output-escaping="yes">&lt;/option&gt;</xsl:text>   </xsl:for-each> </select>
<p><br/> <input type="submit" value="Add"/>   </form>
</p>
<p> </xsl:otherwise>   </xsl:choose>  </xsl:template>  </xsl:stylesheet>    <br />We highly recommend you visit <a href="http://coldfusion.smartwebsitehosting.net">web and email hosting</a> services if you need stable and cheap web hosting platform for your web applications.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.tomcatjavahosting.com/tomcat/web-host-server-414-chapter-13-case-study-using-php/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>CHAPTER 13   CASE STUDY: USING PHP FOR  (Apache web server)</title>
		<link>http://www.tomcatjavahosting.com/tomcat/chapter-13-case-study-using-php-for-apache-web-server/</link>
		<comments>http://www.tomcatjavahosting.com/tomcat/chapter-13-case-study-using-php-for-apache-web-server/#comments</comments>
		<pubDate>Sun, 20 Jan 2008 14:23:17 +0000</pubDate>
		<dc:creator>humphreyblogart</dc:creator>
		
	<category>Tomcat</category>
		<guid isPermaLink="false">http://www.tomcatjavahosting.com/tomcat/chapter-13-case-study-using-php-for-apache-web-server/</guid>
		<description><![CDATA[CHAPTER 13   CASE STUDY: USING PHP FOR AN XML APPLICATION 413   The stylesheet needs to check the value of the $numTemp variable. If the value is 0, there are  no weather records, and it will display an appropriate message:       There are currently no entries [...]]]></description>
			<content:encoded><![CDATA[<p>CHAPTER 13   CASE STUDY: USING PHP FOR AN XML APPLICATION 413   The stylesheet needs to check the value of the $numTemp variable. If the value is 0, there are  no weather records, and it will display an appropriate message:   <xsl:choose>   <xsl:when test="$numTemp=0"> There are currently no entries for <xsl:value-of select="weather/city"/>   </xsl:when>   If the value isn t 0, there are weather details that the stylesheet can display. As I m writing  this from Australia, I use the Celsius temperature scale. The database stores the temperatures  in Celsius, but the application needs to display both Celsius and Fahrenheit values. The  stylesheet converts the existing Celsius temperatures to Fahrenheit values and stores them in  variables:   <xsl:otherwise>  <xsl:variable name="MinF">   <xsl:value-of select="round(((weather/temperature/minimum * 9) div 5)+ 32)"/>  </xsl:variable>  <xsl:variable name="MaxF">   <xsl:value-of select="round(((weather/temperature/maximum * 9) div 5)+ 32)"/>  </xsl:variable>   The stylesheet displays the weather outlook using images designed by Gavin Cromhout.  You can find them in the imagesfolder. It chooses the images in the following way:   <strong>Outlook:</strong><br/> <xsl:text disable-output-escaping="yes">&lt;img src=&#8221;images/</xsl:text> <xsl:value-of select="weather/outlook"/> <xsl:text disable-output-escaping="yes">.jpg&#8221; width=&#8221;100&#8243; height=&#8221;80&#8243; . alt=&#8221;</xsl:text> <xsl:value-of select="weather/outlook"/> <xsl:text disable-output-escaping="yes">&#8221; /&gt;</xsl:text><br/>   It then displays the minimum and maximum temperatures in a table:<br />
<table border="0">
<tr>
<td/>
<td><strong>C</strong></td>
<td><strong>F</strong></td>
</tr>
<tr>
<td><strong>Minimum</strong></td>
<td><xsl:value-of select="weather/temperature/minimum"/></td>
<td><xsl:value-of select="$MinF"/></td>
</tr>
<tr>
<td><strong>Maximum</strong></td>
<td><xsl:value-of select="weather/temperature/maximum"/></td>
<p>You want to have a cheap webhost for your apache application, then check <a href="http://apache.tomcatjavahosting.com">apache web hosting</a> services.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.tomcatjavahosting.com/tomcat/chapter-13-case-study-using-php-for-apache-web-server/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>412 CHAPTER 13   CASE STUDY: USING PHP  (Jetty web server)</title>
		<link>http://www.tomcatjavahosting.com/tomcat/412-chapter-13-case-study-using-php-jetty-web-server/</link>
		<comments>http://www.tomcatjavahosting.com/tomcat/412-chapter-13-case-study-using-php-jetty-web-server/#comments</comments>
		<pubDate>Sun, 20 Jan 2008 04:08:30 +0000</pubDate>
		<dc:creator>humphreyblogart</dc:creator>
		
	<category>Tomcat</category>
		<guid isPermaLink="false">http://www.tomcatjavahosting.com/tomcat/412-chapter-13-case-study-using-php-jetty-web-server/</guid>
		<description><![CDATA[412 CHAPTER 13   CASE STUDY: USING PHP FOR AN XML APPLICATION   The application also adds the outlook to the document. Because the code sorts the query  in reverse count order, it displays the first record, which contains the highest number of  responses:   $outlook = $xml->createElement(&#8217;outlook&#8217;, $wrow[&#8217;weatherType&#8217;]);  [...]]]></description>
			<content:encoded><![CDATA[<p>412 CHAPTER 13   CASE STUDY: USING PHP FOR AN XML APPLICATION   The application also adds the outlook to the document. Because the code sorts the query  in reverse count order, it displays the first record, which contains the highest number of  responses:   $outlook = $xml->createElement(&#8217;outlook&#8217;, $wrow[&#8217;weatherType&#8217;]);  $outlook = $root->appendChild($outlook);   As the page finishes with the weather report, it can output the available weather types.  You ve seen this code before:   $types = $xml->createElement(&#8217;weathertypes&#8217;); $types = $root->appendChild($types); $sql = &#8216;SELECT weatherTypeID, weatherType FROM weatherType&#8217;; $tRes = mysql_query($sql) or die(mysql_error() . &#8220;n<br />&#8221; . $sql); while ($tRow = mysql_fetch_array($tRes)) {   $type = $xml->createElement(&#8217;type&#8217;, $tRow[&#8217;weatherType&#8217;]); $type->setAttribute(&#8217;id&#8217;, $tRow[&#8217;weatherTypeID&#8217;]); $type = $types->appendChild($type);   }  }   weather.xsl   The application needs to transform the XML content using the XSLT stylesheet weather.xsl.  The stylesheet starts in the following way:   <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">   It then checks that there are weather results by counting the number of temperature elements and storing the value in a variable:   <xsl:variable name="numTemp">  <xsl:value-of select="count(weather/temperature)"/>  </xsl:variable>   The value is 1 if users have entered a forecast, and 0 if there are no database results.  The stylesheet can then test to see if an error occurred:   <xsl:template match="/">  <xsl:choose>   <xsl:when test="//weather/city='Error'"><br />
<h4>Error</h4>
<p> <xsl:value-of select="weather/error"/>   </xsl:when>   If there is an error, the stylesheet displays the details; otherwise, it displays the weather  title:   <xsl:otherwise><br />
<h4>Weather for <xsl:value-of select="weather/city"/></h4>
<p>Searching for affordable and reliable webhost to host and run your web applications? Go to our <a href="http://www.smartwebsitehosting.net">java web server</a> services and you will be pleased.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.tomcatjavahosting.com/tomcat/412-chapter-13-case-study-using-php-jetty-web-server/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>CHAPTER 13   CASE STUDY:  (Managed web hosting) USING PHP FOR</title>
		<link>http://www.tomcatjavahosting.com/tomcat/chapter-13-case-study-managed-web-hosting-using-php-for/</link>
		<comments>http://www.tomcatjavahosting.com/tomcat/chapter-13-case-study-managed-web-hosting-using-php-for/#comments</comments>
		<pubDate>Sat, 19 Jan 2008 17:20:58 +0000</pubDate>
		<dc:creator>humphreyblogart</dc:creator>
		
	<category>Tomcat</category>
		<guid isPermaLink="false">http://www.tomcatjavahosting.com/tomcat/chapter-13-case-study-managed-web-hosting-using-php-for/</guid>
		<description><![CDATA[CHAPTER 13   CASE STUDY: USING PHP FOR AN XML APPLICATION 411   As the application shouldn t store the outdated weather entries in the database, the code  uses the $weatherWindow variable to delete the old records. That way, the code can just select  the remaining records:   $sql = [...]]]></description>
			<content:encoded><![CDATA[<p>CHAPTER 13   CASE STUDY: USING PHP FOR AN XML APPLICATION 411   As the application shouldn t store the outdated weather entries in the database, the code  uses the $weatherWindow variable to delete the old records. That way, the code can just select  the remaining records:   $sql = &#8216;DELETE FROM weather WHERE weatherCityID=&#8217; . $city . &#8216; . AND weatherDate < ' . $weatherWindow; mysql_query($sql) or die(mysql_error() . "n<br />&#8221; . $sql);   The application also determines the forecast, based on how many people select each  weather type. If 10 people indicate that the weather is sunny, and one person adds that it s  raining, the application can probably assume that the weather is sunny. It could extend the  logic and analyze weather changes over time, but that s beyond the scope of this application.  The application determines weather type by counting the number of each type of entry:   $sql = &#8216;SELECT count(weather.weatherWeatherTypeID) AS tOrder, .  weathertype.weatherType FROM weather, weathertype .  WHERE weatherWeatherTypeID=weatherTypeID and weatherCityID =&#8217; . $city . &#8216; .  GROUP BY weatherWeatherTypeID ORDER BY tOrder DESC&#8217;;   $wres = mysql_query($sql) or die(mysql_error() . &#8220;n<br />&#8221; . $sql);   If the query returns no records, there are no current weather reports. It doesn t need to  add any weather data to the XML document. It will only proceed if there are more than zero  rows of data:   if (mysql_num_rows($wres) > 0) {  $wrow = mysql_fetch_array($wres);   The code retrieves the minimum and maximum values by averaging the temperatures.  It rounds the averaged value to display a whole number:   $sql = &#8216;SELECT ROUND(AVG(weatherMax)) AS maxavg FROM weather .   WHERE weatherCityID =&#8217; . $city;  $wMaxRes = mysql_query($sql) or die(mysql_error() . &#8220;n<br />&#8221; . $sql);  $wMaxRow = mysql_fetch_array($wMaxRes);  $sql = &#8216;SELECT ROUND(AVG(weatherMin)) AS minavg FROM weather .   WHERE weatherCityID =&#8217; . $city;  $wMinRes = mysql_query($sql) or die(mysql_error() . &#8220;n<br />&#8221; . $sql);  $wMinRow = mysql_fetch_array($wMinRes);   The page needs to add these elements to the XML document:   $temp = $xml->createElement(&#8217;temperature&#8217;);  $temp = $root->appendChild($temp);  $min = $xml->createElement(&#8217;minimum&#8217;, $wMinRow[&#8217;minavg&#8217;]);  $min = $temp->appendChild($min);  $max = $xml->createElement(&#8217;maximum&#8217;, $wMaxRow[&#8217;maxavg&#8217;]);  $max = $temp->appendChild($max);    <br />Searching for affordable and proven webhost to host and run your servlet applications? Go to <a href="http://linux.g5websitehosting.com">Linux Web Hosting</a> services and you will find it.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.tomcatjavahosting.com/tomcat/chapter-13-case-study-managed-web-hosting-using-php-for/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>410 CHAPTER 13   CASE  (Web site design) STUDY: USING PHP</title>
		<link>http://www.tomcatjavahosting.com/tomcat/410-chapter-13-case-web-site-design-study-using-php/</link>
		<comments>http://www.tomcatjavahosting.com/tomcat/410-chapter-13-case-web-site-design-study-using-php/#comments</comments>
		<pubDate>Sat, 19 Jan 2008 07:26:32 +0000</pubDate>
		<dc:creator>humphreyblogart</dc:creator>
		
	<category>Tomcat</category>
		<guid isPermaLink="false">http://www.tomcatjavahosting.com/tomcat/410-chapter-13-case-web-site-design-study-using-php/</guid>
		<description><![CDATA[410 CHAPTER 13   CASE STUDY: USING PHP FOR AN XML APPLICATION   Building the XML Document   The mk_weather.php script starts by including the weather.php page and creating a new  DomDocument:   xmlStandalone = false;  $root = $xml->createElement(&#8217;weather&#8217;);  $root = $xml->appendChild($root);   The page needs to [...]]]></description>
			<content:encoded><![CDATA[<p>410 CHAPTER 13   CASE STUDY: USING PHP FOR AN XML APPLICATION   Building the XML Document   The mk_weather.php script starts by including the weather.php page and creating a new  DomDocument:   <?php include_once 'weather.php'; $xml = new DomDocument('1.0', 'UTF-8');   It then adds the XML declaration and the <weather> element:   $xml->xmlStandalone = false;  $root = $xml->createElement(&#8217;weather&#8217;);  $root = $xml->appendChild($root);   The page needs to query the database to find out the city name. This code also tests  whether users have passed in a valid id for the city:   $sql = &#8216;SELECT * FROM city WHERE cityID =&#8217; . $city;  $cres = mysql_query($sql) or die(mysql_error() . &#8220;n<br />&#8221; . $sql);   If the idis not valid, the code generates an error:   if (mysql_num_rows($cres) == 0) {  $cityElement = $xml->createElement(&#8217;city&#8217;, &#8216;Error&#8217;);  $root->appendChild($cityElement);  $error = $xml->createElement(&#8217;error&#8217;, &#8216;You appear to have selected .   an invalid city&#8217;);  $root->appendChild($error);  }   If the application has a valid city id, it retrieves the name of the city and adds it to the  XML document:   else {  $crow = mysql_fetch_array($cres);  $city_name = $crow[&#8217;city&#8217;];  $cityElement = $xml->createElement(&#8217;city&#8217;, $city_name);  $cityElement->setAttribute(&#8217;id&#8217;, $city);  $cityElement = $root->appendChild($cityElement);   The code uses the createElement(), setAttribute(), and appendChild() methods to add  the content.   Because the application should only show the current weather reports, you can filter the  details to show only current entries. In this application, entries added in the last eight hours  are current. The variable $weatherWindow has a value of the current time minus eight hours, or  28800 seconds:   $weatherWindow = time() - 28800;    <br />Check <a href="http://domain.tomcatjavahosting.com">Tomcat Web Hosting</a> services for best quality webspace to host your web application.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.tomcatjavahosting.com/tomcat/410-chapter-13-case-web-site-design-study-using-php/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>CHAPTER 13   CASE STUDY: USING PHP FOR  (Web server hosting)</title>
		<link>http://www.tomcatjavahosting.com/tomcat/chapter-13-case-study-using-php-for-web-server-hosting/</link>
		<comments>http://www.tomcatjavahosting.com/tomcat/chapter-13-case-study-using-php-for-web-server-hosting/#comments</comments>
		<pubDate>Fri, 18 Jan 2008 21:11:58 +0000</pubDate>
		<dc:creator>humphreyblogart</dc:creator>
		
	<category>Tomcat</category>
		<guid isPermaLink="false">http://www.tomcatjavahosting.com/tomcat/chapter-13-case-study-using-php-for-web-server-hosting/</guid>
		<description><![CDATA[CHAPTER 13   CASE STUDY: USING PHP FOR AN XML APPLICATION 409   The page also contains a form that allows users to add a new weather report. To make life  easier, the application provides a list of weather types in a drop-down list. This information  comes from the  element. [...]]]></description>
			<content:encoded><![CDATA[<p>CHAPTER 13   CASE STUDY: USING PHP FOR AN XML APPLICATION 409   The page also contains a form that allows users to add a new weather report. To make life  easier, the application provides a list of weather types in a drop-down list. This information  comes from the <weathertypes> element.   Scenario 2: Changing Querystring Variables   The second possibility occurs when users edit the querystring to add an invalid city code. This  would produce the following XML document:   <?xml version="1.0" encoding="UTF-8"?>   <weather>  <city>Error</city>  <error>You appear to have selected an invalid city</error>   </weather>   This document provides users with an error message.   Scenario 3: Current Weather Reports Available   The final scenario shows a current weather report for the selected city. The XML document  needs to include the current weather conditions with the possible weather types:   <?xml version="1.0" encoding="UTF-8"?>   <weather>  <city id="4">Perth</city>  <temperature>   <minimum>20</minimum>   <maximum>35</maximum> </temperature> <outlook>hot</outlook> <weathertypes>   <type id="1">hot</type> <type id="2">sunny</type> <type id="3">windy</type> <type id="4">cloudy</type> <type id="5">rain</type> <type id="6">rainstorms</type> <type id="7">snow</type> <type id="8">snowstorms</type>   </weathertypes>  </weather>   The <temperature> element provides the minimum and maximum temperatures. The  <outlook> element is the current outlook for the city. It contains one of the predefined weather  types.   Now that you ve seen the XML document structures, I ll look at the code that builds these  structures from the database.    <br />If you are in need for cheap and reliable webhost to host your website, we recommend <a href="http://mysql5.tomcatjavahosting.com">http web server</a> services.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.tomcatjavahosting.com/tomcat/chapter-13-case-study-using-php-for-web-server-hosting/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Web server version - 408 CHAPTER 13   CASE STUDY: USING PHP</title>
		<link>http://www.tomcatjavahosting.com/tomcat/web-server-version-408-chapter-13-case-study-using-php/</link>
		<comments>http://www.tomcatjavahosting.com/tomcat/web-server-version-408-chapter-13-case-study-using-php/#comments</comments>
		<pubDate>Fri, 18 Jan 2008 10:29:43 +0000</pubDate>
		<dc:creator>humphreyblogart</dc:creator>
		
	<category>Tomcat</category>
		<guid isPermaLink="false">http://www.tomcatjavahosting.com/tomcat/web-server-version-408-chapter-13-case-study-using-php/</guid>
		<description><![CDATA[408 CHAPTER 13   CASE STUDY: USING PHP FOR AN XML APPLICATION   Scenario 1: No Current Weather Reports   In the first scenario, the selected city has no current weather reports. Figure 13-12 shows how  this appears to users.    Figure 13-12. There is no current weather report [...]]]></description>
			<content:encoded><![CDATA[<p>408 CHAPTER 13   CASE STUDY: USING PHP FOR AN XML APPLICATION   Scenario 1: No Current Weather Reports   In the first scenario, the selected city has no current weather reports. Figure 13-12 shows how  this appears to users.    Figure 13-12. There is no current weather report to display.   The XML document describing the weather in this scenario would appear as follows:   <?xml version="1.0" encoding="UTF-8"?>   <weather>  <city id="4">Perth</city>  <weathertypes>   <type id="1">hot</type> <type id="2">sunny</type> <type id="3">windy</type> <type id="4">cloudy</type> <type id="5">rain</type> <type id="6">rainstorms</type> <type id="7">snow</type> <type id="8">snowstorms</type>   </weathertypes>  </weather>   The <weather> element is the document element. This element includes the <city> element, which contains the city name as text and an attribute with the id from the database.    <br />Please visit our <a href="http://php5.smartwebsitehosting.net">professional web hosting</a> services to find out about cheap and reliable webhost service that will surely answer all your demands.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.tomcatjavahosting.com/tomcat/web-server-version-408-chapter-13-case-study-using-php/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Zeus web server - CHAPTER 13   CASE STUDY: USING PHP FOR</title>
		<link>http://www.tomcatjavahosting.com/tomcat/zeus-web-server-chapter-13-case-study-using-php-for/</link>
		<comments>http://www.tomcatjavahosting.com/tomcat/zeus-web-server-chapter-13-case-study-using-php-for/#comments</comments>
		<pubDate>Thu, 17 Jan 2008 22:30:20 +0000</pubDate>
		<dc:creator>humphreyblogart</dc:creator>
		
	<category>Tomcat</category>
		<guid isPermaLink="false">http://www.tomcatjavahosting.com/tomcat/zeus-web-server-chapter-13-case-study-using-php-for/</guid>
		<description><![CDATA[CHAPTER 13   CASE STUDY: USING PHP FOR AN XML APPLICATION 407   if (strlen($sql) > 0) {   mysql_query($sql) or die(mysql_error()); } header(&#8217;Location: index.php?&#8217; . $current . &#8216;=&#8217; . $parent);   ?>   The $current variable contains the previous navigation level, while $parent contains the  id of that [...]]]></description>
			<content:encoded><![CDATA[<p>CHAPTER 13   CASE STUDY: USING PHP FOR AN XML APPLICATION 407   if (strlen($sql) > 0) {   mysql_query($sql) or die(mysql_error()); } header(&#8217;Location: index.php?&#8217; . $current . &#8216;=&#8217; . $parent);   ?>   The $current variable contains the previous navigation level, while $parent contains the  id of that entry. I ve now worked through the code that builds the site navigation.   The remainder of the application handles the weather details. The mk_weather.php,  weather.xsl, and addweather.php scripts deal with the weather details. The application uses  the same approach as it did with the navigation. The mk_weather.php script generates the  weather XML, which weather.xsl transforms into XHTML. The addweather.php page allows  users to add new weather details.   mk_weather.php   The mk_weather.php page generates the XML document containing current weather details.  It uses the following template:   <?xml version="1.0" encoding="UTF-8"?>   <weather>  <city id=""> </city>  <temperature>   <minimum></minimum>   <maximum></maximum> </temperature> <outlook>hot</outlook> <weathertypes>   <type id=""> </type>  </weathertypes>  </weather>   There are three possibilities for the structure of the XML document that the application  generates:   1. There is no current weather report.  2. The values in the querystring change and cause an error.  3. There is a current weather report.  I ll work through each scenario.    <br />From our experience, we are can tell you that you can find a reliable and cheap webhost service at <a href="http://www.tomcatjavahosting.com">Java Web Hosting</a> services.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.tomcatjavahosting.com/tomcat/zeus-web-server-chapter-13-case-study-using-php-for/feed/</wfw:commentRSS>
		</item>
	</channel>
</rss>
