<?xml version="1.0" encoding="UTF-8"?>
<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/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>iTechLog &#187; foreach()</title>
	<atom:link href="http://itechlog.com/tag/foreach/feed/" rel="self" type="application/rss+xml" />
	<link>http://itechlog.com</link>
	<description>Your source to IT solutions, interesting technology news and code snipets.</description>
	<lastBuildDate>Mon, 06 Sep 2010 12:05:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>Automatically display form data with PHP</title>
		<link>http://itechlog.com/web-programming/2009/05/13/automatically-display-form-data-with-php/</link>
		<comments>http://itechlog.com/web-programming/2009/05/13/automatically-display-form-data-with-php/#comments</comments>
		<pubDate>Wed, 13 May 2009 12:23:44 +0000</pubDate>
		<dc:creator>Alex Costa</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Programming]]></category>
		<category><![CDATA[$_POST]]></category>
		<category><![CDATA[foreach()]]></category>
		<category><![CDATA[html form]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://itechlog.com/?p=723</guid>
		<description><![CDATA[This is a simple PHP  script to automatically display (dump output)  data submited from a html form. The form setup all inputs (form fields) need to have the same name with [] at the end to turn it into an array,  e.g &#60;input type=text name=formdata[]&#62; formq.html content &#60;form method=post action=showme.php&#62; Name: &#60;input type=text name=formdata[]&#62;&#60;br&#62; Email: [...]]]></description>
			<content:encoded><![CDATA[<p>This is a simple PHP  script to automatically display (<strong>dump output</strong>)  data submited from a html form.</p>
<p><strong>The form setup</strong></p>
<ul>
<li>all inputs (form fields) need to have the same name with [] at the end to turn it into an array,  e.g &lt;input type=text name=formdata[]&gt;</li>
</ul>
<p style="padding-left: 30px;">formq.html content</p>
<p style="padding-left: 30px;"><span style="color: #3366ff;">&lt;form method=post action=showme.php&gt;<br />
Name: &lt;input type=text name=formdata[]&gt;&lt;br&gt;<br />
Email: &lt;input type=text name=formdata[]&gt;&lt;br&gt;<br />
</span></p>
<p style="padding-left: 30px;"><span style="color: #3366ff;">&lt;input type=submit value=ok&gt;<br />
&lt;/form&gt;</span>
</p>
<p style="padding-left: 30px;">
<p><strong>The Script setup</strong></p>
<p style="padding-left: 30px;">showme.php content</p>
<p style="padding-left: 30px;"><span style="color: #3366ff;">&lt;?php<br />
$data = $_POST['formdata']; # get value from the form fields</span>
</p>
<p style="padding-left: 30px;"><span style="color: #3366ff;">foreach ( $data as $key =&gt; $value ) { # loop through array collecting the results</span></p>
<p style="padding-left: 30px;"><span style="color: #3366ff;">echo  &#8220;$value&lt;br&gt;&#8221;;  # output the data  &#8211; print to page<br />
}<br />
?&gt;</span></p>
<ul class="socialwrap size32 row">
<li class="iconOnly"><a rel="nofollow" target="_blank" class="delicious" href="http://delicious.com/post?url=http%3A%2F%2Fitechlog.com%2Fweb-programming%2F2009%2F05%2F13%2Fautomatically-display-form-data-with-php%2F&amp;title=Automatically+display+form+data+with+PHP" title="Bookmark this post : Automatically display form data with PHP on Delicious"><span class="head">Bookmark on Delicious</span></a></li>
<li class="iconOnly"><a rel="nofollow" target="_blank" class="digg" href="http://digg.com/submit?url=http%3A%2F%2Fitechlog.com%2Fweb-programming%2F2009%2F05%2F13%2Fautomatically-display-form-data-with-php%2F&amp;title=Automatically+display+form+data+with+PHP&amp;bodytext=This+is+a+simple+PHP%C2%A0+script+to+automatically+display+%28dump+output%29%C2%A0+data+submited+from+a+html+form.%0D%0A%0D%0AThe+form+setup%0D%0A%0D%0A%09all+inputs+%28form+fields%29+need+to+have+the+same+name+with+%5B%5D+at+the+end+to+turn+it+into+an+array%2C%C2%A0+e.g+%26lt%3Binput+type%3Dtext+name%3Dformdata%5B%5D%26gt%3B%0D%0A%0D%0Aformq.html+content%0D%0A%0D%0A%26lt%3Bform+method%3Dpost+action" title="Digg this post : Automatically display form data with PHP"><span class="head">Digg this post</span></a></li>
<li class="iconOnly"><a rel="nofollow" target="_blank" class="facebook" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fitechlog.com%2Fweb-programming%2F2009%2F05%2F13%2Fautomatically-display-form-data-with-php%2F&amp;t=Automatically+display+form+data+with+PHP" title="Recommend this post : Automatically display form data with PHP on Facebook"><span class="head">Recommend on Facebook</span></a></li>
<li class="iconOnly"><a rel="nofollow" target="_blank" class="google_buzz" href="http://www.google.com/reader/link?url=http%3A%2F%2Fitechlog.com%2Fweb-programming%2F2009%2F05%2F13%2Fautomatically-display-form-data-with-php%2F&amp;title=Automatically+display+form+data+with+PHP" title="Buzz up this post : Automatically display form data with PHP "><span class="head">Buzz it up</span></a></li>
<li class="iconOnly"><a rel="nofollow" target="_blank" class="yahoo_buzz" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fitechlog.com%2Fweb-programming%2F2009%2F05%2F13%2Fautomatically-display-form-data-with-php%2F" title="Buzz up this post : Automatically display form data with PHP "><span class="head">Buzz it up</span></a></li>
<li class="iconOnly"><a rel="nofollow" target="_blank" class="orkut" href="http://promote.orkut.com/preview?nt=orkut.com&amp;du=http%3A%2F%2Fitechlog.com%2Fweb-programming%2F2009%2F05%2F13%2Fautomatically-display-form-data-with-php%2F&amp;tt=Automatically+display+form+data+with+PHP" title="Share this post : Automatically display form data with PHP on Orkut"><span class="head">Share on Orkut</span></a></li>
<li class="iconOnly"><a rel="nofollow" target="_blank" class="reddit" href="http://www.reddit.com/submit?url=http%3A%2F%2Fitechlog.com%2Fweb-programming%2F2009%2F05%2F13%2Fautomatically-display-form-data-with-php%2F&amp;title=Automatically+display+form+data+with+PHP" title="Share this post : Automatically display form data with PHP on Reddit"><span class="head">share via Reddit</span></a></li>
<li class="iconOnly"><a rel="nofollow" target="_blank" class="stumble" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fitechlog.com%2Fweb-programming%2F2009%2F05%2F13%2Fautomatically-display-form-data-with-php%2F&amp;title=Automatically+display+form+data+with+PHP" title="Share this post : Automatically display form data with PHP with Stumblers"><span class="head">Share with Stumblers</span></a></li>
<li class="iconOnly"><a rel="nofollow" target="_blank" class="twitter" href="http://twitter.com/home/?status=http%3A%2F%2Fitechlog.com%2Fweb-programming%2F2009%2F05%2F13%2Fautomatically-display-form-data-with-php%2F" title="Tweet this post : Automatically display form data with PHP on Twitter"><span class="head">Tweet about it</span></a></li>
<li class="iconOnly"><a rel="nofollow" target="" class="rss" href="http://itechlog.com/web-programming/2009/05/13/automatically-display-form-data-with-php/feed" title="Follow this post : Automatically display form data with PHP comments"><span class="head">Subscribe to the comments on this post</span></a></li>
<li class="iconOnly"><a rel="" class="email" href="mailto:?subject=iTechLog : Automatically display form data with PHP&#038;body=here is a link to a site I really like.   http://itechlog.com/web-programming/2009/05/13/automatically-display-form-data-with-php/" title="Tell a friend about this post : Automatically display form data with PHP "><span class="head">Tell a friend</span></a></li>
</ul>
<div class="clean"></div>

<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/%24_POST' rel='tag' target='_self'>$_POST</a>, <a class='technorati-link' href='http://technorati.com/tag/foreach%28%29' rel='tag' target='_self'>foreach()</a>, <a class='technorati-link' href='http://technorati.com/tag/html+form' rel='tag' target='_self'>html form</a>, <a class='technorati-link' href='http://technorati.com/tag/PHP' rel='tag' target='_self'>PHP</a>, <a class='technorati-link' href='http://technorati.com/tag/Programming' rel='tag' target='_self'>Programming</a></p>

<!-- end wp-tags-to-technorati -->
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li>December 4, 2008 -- <a href="http://itechlog.com/web-programming/2008/12/04/search-engine-optimization-seo-in-php-book/" title="Search Engine Optimization  SEO in PHP (Book)">Search Engine Optimization  SEO in PHP (Book)</a></li><li>July 8, 2009 -- <a href="http://itechlog.com/itechlog-news/2009/07/08/android-to-iphone-apps-with-xml/" title="Android to iPhone Apps with XML">Android to iPhone Apps with XML</a></li><li>June 20, 2009 -- <a href="http://itechlog.com/itechlog-news/2009/06/20/opensuse-factory/" title="OpenSuse Factory">OpenSuse Factory</a></li><li>April 14, 2009 -- <a href="http://itechlog.com/web-programming/2009/04/14/pdf-to-email-with-registration/" title="PDF to Email with registration">PDF to Email with registration</a></li><li>February 18, 2009 -- <a href="http://itechlog.com/open-source/2009/02/18/sugarcrm-installation-error-sessionsave_path-not-set/" title="SugarCRM Installation error: session.save_path not set">SugarCRM Installation error: session.save_path not set</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://itechlog.com/web-programming/2009/05/13/automatically-display-form-data-with-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
