<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[KillerSites.com Web Design Forums - PHP XML question]]></title>
		<link>http://www.killersites.com/forums/topic/2312/php-xml-question/</link>
		<description><![CDATA[The most recent posts in PHP XML question.]]></description>
		<lastBuildDate>Thu, 15 Oct 2009 19:25:20 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: PHP XML question]]></title>
			<link>http://www.killersites.com/forums/post/11461/#p11461</link>
			<description><![CDATA[<p>One other quick thing to check... this line in your category.php file has a misspelling:</p><div class="codebox"><pre><code>foreach ($cateogory-&gt;item as $item) &lt;-- &quot;category&quot;</code></pre></div><p>...doesn&#039;t look like that is necessarily connected to the issues you are having on your index page though.</p>]]></description>
			<author><![CDATA[dummy@example.com (falkencreative)]]></author>
			<pubDate>Thu, 15 Oct 2009 19:25:20 +0000</pubDate>
			<guid>http://www.killersites.com/forums/post/11461/#p11461</guid>
		</item>
		<item>
			<title><![CDATA[Re: PHP XML question]]></title>
			<link>http://www.killersites.com/forums/post/11460/#p11460</link>
			<description><![CDATA[<p>FalkenCreative,<br />My real XMl file looks like this and it does have the closing category tags. I have tested it in W3C validator and is a valid XML plus I can parse it to get the category name. The one a created here was just so you guys could get the picture. I think the problem is on my PHP. Thank you anyway.</p><br /><p>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&gt; <br />&lt;menu&gt;<br />&lt;category name=&quot;Pizzas&quot;&gt;<br />&lt;item id=&quot;1&quot;&gt;<br />&lt;name&gt;Tomato and Cheese&lt;/name&gt; <br />&lt;price&gt;<br />&lt;sm&gt;5.50&lt;/sm&gt; <br />&lt;lg&gt;9.75&lt;/lg&gt; <br />&lt;/price&gt;<br />&lt;/item&gt;<br />&lt;item id=&quot;2&quot;&gt;<br />&lt;name&gt;Broccoli&lt;/name&gt; <br />&lt;price&gt;<br />&lt;sm&gt;6.85&lt;/sm&gt; <br />&lt;lg&gt;10.85&lt;/lg&gt; <br />&lt;/price&gt;<br />&lt;/item&gt;<br />&lt;item id=&quot;3&quot;&gt;<br />&lt;name&gt;Onions&lt;/name&gt; <br />&lt;price&gt;<br />&lt;sm&gt;6.85&lt;/sm&gt; <br />&lt;lg&gt;10.85&lt;/lg&gt; <br />&lt;/price&gt;<br />&lt;/item&gt;<br />&lt;item id=&quot;4&quot;&gt;<br />&lt;name&gt;Peppers&lt;/name&gt; <br />&lt;price&gt;<br />&lt;sm&gt;6.85&lt;/sm&gt; <br />&lt;lg&gt;10.85&lt;/lg&gt; <br />&lt;/price&gt;<br />&lt;/item&gt;<br />&lt;/category&gt;<br />&lt;category name=&quot;Speciality Pizzas&quot; sm=&quot;9.80&quot; lg=&quot;15.80&quot;&gt;<br />&lt;item id=&quot;5&quot;&gt;<br />&lt;name&gt;Mediterranean&lt;/name&gt; <br />&lt;description&gt;Sliced Tomatoes, Olives, Spinach, Fresh Garlic, Mozzarella and Feta Cheese&lt;/description&gt; <br />&lt;/item&gt;<br />&lt;item id=&quot;6&quot;&gt;<br />&lt;name&gt;Vegetarian&lt;/name&gt; <br />&lt;description&gt;Sliced Tomatoes, Onions, Peppers, Mushrooms, Broccoli and Mozzarella&lt;/description&gt; <br />&lt;/item&gt;<br />&lt;item id=&quot;7&quot;&gt;<br />&lt;name&gt;Faux BBQ Grilled Chicken&lt;/name&gt; <br />&lt;description&gt;Choice Of Vegetables&lt;/description&gt; <br />&lt;/item&gt;<br />&lt;/category&gt;<br />.......etc etc ect<br />........</p>]]></description>
			<author><![CDATA[dummy@example.com (tonyg33)]]></author>
			<pubDate>Thu, 15 Oct 2009 19:23:09 +0000</pubDate>
			<guid>http://www.killersites.com/forums/post/11460/#p11460</guid>
		</item>
		<item>
			<title><![CDATA[Re: PHP XML question]]></title>
			<link>http://www.killersites.com/forums/post/11459/#p11459</link>
			<description><![CDATA[<p>Just a quick glance at the XML file... Looks like you forgot to add closing &lt;/category&gt; tags?</p>]]></description>
			<author><![CDATA[dummy@example.com (falkencreative)]]></author>
			<pubDate>Thu, 15 Oct 2009 18:59:40 +0000</pubDate>
			<guid>http://www.killersites.com/forums/post/11459/#p11459</guid>
		</item>
		<item>
			<title><![CDATA[PHP XML question]]></title>
			<link>http://www.killersites.com/forums/post/11458/#p11458</link>
			<description><![CDATA[<p>I have an XML like this.</p><p>&lt;menu&gt;<br />&lt;category name=&quot;Fruit&quot;&gt;<br />&lt;item id=&quot;1&quot;&gt;<br />&lt;name&gt;Apple&lt;/name&gt; <br />&lt;price&gt;<br />&lt;sm&gt;5.50&lt;/sm&gt; <br />&lt;lg&gt;9.75&lt;/lg&gt; <br />&lt;/price&gt;<br />&lt;/item&gt;<br />&lt;category name=&quot;Desert&quot;&gt;<br />&lt;item id=&quot;23&quot;&gt;<br />&lt;name&gt;Ice Cream&lt;/name&gt; <br />&lt;price&gt;7.35&lt;/price&gt; <br />&lt;/item&gt;<br />&lt;menu&gt;</p><br /><p>My index.php looks like this and it gives me the drop down box and displays only the name of the first category.</p><p>&lt;?php </p><p>$xml_file = file_get_contents(&quot;testmenu.xml&quot;); </p><p>$xml = simplexml_load_string($xml_file); </p><br /><p>echo &#039;&lt;form name=&quot;products&quot; action=&quot;category.php&quot; method=&quot;post&quot;&gt;&#039;; <br />echo &#039;&lt;select&gt;&#039;; <br />foreach ($xml-&gt;category as $category) <br />{ <br />echo &quot;&lt;option&gt; &quot;.$category[&#039;name&#039;].&quot;&lt;/option&gt;&quot;; <br /> } <br />echo &#039;&lt;/select&gt;&#039;; <br />echo &#039;&lt;/form&gt;&#039;; </p><p>?&gt; </p><br /><p>My Category.php looks like this and it Doesn&#039;t WORK.</p><p>&lt;?php</p><p>$category = $_Post[&#039;products&#039;]</p><p>$xml_file = file_get_contents(&quot;testmenu.xml&quot;); </p><br /><br /><p>foreach ($cateogory-&gt;item as $item)<br />{<br />echo $item[&#039;name&#039;];<br />}</p><p>?&gt;</p><br /><p>Where is my mistake? any thoughts? I have been looking all over trying to find a solution for 5 days now. Any help will be greatly appriciated.</p>]]></description>
			<author><![CDATA[dummy@example.com (tonyg33)]]></author>
			<pubDate>Thu, 15 Oct 2009 18:27:55 +0000</pubDate>
			<guid>http://www.killersites.com/forums/post/11458/#p11458</guid>
		</item>
	</channel>
</rss>
