<?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; PHP</title>
	<atom:link href="http://itechlog.com/category/php/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>Tue, 10 Jan 2012 17:06:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>It is not safe to rely on the system’s timezone settings</title>
		<link>http://itechlog.com/web-programming/2011/01/31/it-is-not-safe-to-rely-on-the-systems-timezone-settings/</link>
		<comments>http://itechlog.com/web-programming/2011/01/31/it-is-not-safe-to-rely-on-the-systems-timezone-settings/#comments</comments>
		<pubDate>Mon, 31 Jan 2011 14:33:09 +0000</pubDate>
		<dc:creator>Alex Costa</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Programming]]></category>
		<category><![CDATA[DATE]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[php.ini]]></category>
		<category><![CDATA[PHP5]]></category>
		<category><![CDATA[time setting]]></category>

		<guid isPermaLink="false">http://itechlog.com/?p=976</guid>
		<description><![CDATA[<a href="http://itechlog.com/web-programming/2011/01/31/it-is-not-safe-to-rely-on-the-systems-timezone-settings/" title="It is not safe to rely on the system’s timezone settings"></a>Recently I have been having the following error on my PHP code every time I call the PHP function date();  Mostly when running it on my local test server. Warning: date(): It is not safe to rely on the system&#8217;s &#8230;<p class="read-more"><a href="http://itechlog.com/web-programming/2011/01/31/it-is-not-safe-to-rely-on-the-systems-timezone-settings/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://itechlog.com/web-programming/2011/01/31/it-is-not-safe-to-rely-on-the-systems-timezone-settings/" title="It is not safe to rely on the system’s timezone settings"></a><p><img style="float: left; padding-right: 10px;" src="http://itechlog.com/wp-content/uploads/2011/01/php_logo.png" alt="" width="150" height="80" align="left" />Recently I have been having the following error on my PHP code every time I call the PHP function date();  Mostly when running it on my local test server.</p>
<p><strong>Warning: date(): It is not safe to rely on the system&#8217;s timezone settings</strong></p>
<p><strong>Cause:</strong> Since PHP5.1.0 the E_RESTRICT setting causes PHP to report error for every call<br />
 to a date/time function, if no default time is set.<br />
 <strong><br />
 Fix: </strong>There are 2 approaches to  resolving this.</p>
<ol>
<li><strong>Set time setting to your PHP script</strong> with the function <a href="http://php.net/manual/en/function.date-default-timezone-set.php" target="_blank">date_default_timezone_set</a>();  with the intended time zone/location eg: for GMT one can use date_default_timezone_set(&#8216;Europe/London&#8217;); </li>
<li><strong>Set time setting to your php.ini </strong>file by editing the line <a href="http://php.net/manual/en/function.date-default-timezone-set.php" target="_blank"><strong><em>;date.timezone =</em></strong> to <strong><em>date.timezone = &#8220;Europe/London&#8221;</em></strong> </a> or you required location. This is good for setting a server wide time setting. </li>
</ol>

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

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/DATE' rel='tag' target='_self'>DATE</a>, <a class='technorati-link' href='http://technorati.com/tag/error' rel='tag' target='_self'>error</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/php.ini' rel='tag' target='_self'>php.ini</a>, <a class='technorati-link' href='http://technorati.com/tag/PHP5' rel='tag' target='_self'>PHP5</a>, <a class='technorati-link' href='http://technorati.com/tag/time+setting' rel='tag' target='_self'>time setting</a></p>

<!-- end wp-tags-to-technorati -->
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li>October 7, 2011 -- <a href="http://itechlog.com/easy-tips/2011/10/07/spotify-crashes-in-linux-under-wine/" title="Spotify crashes in Linux under Wine">Spotify crashes in Linux under Wine</a></li><li>August 10, 2011 -- <a href="http://itechlog.com/code-snipets/2011/08/10/cardsave-error-transaction-datetime-expired/" title="Cardsave error &#8220;transaction date/time expired&#8221;">Cardsave error &#8220;transaction date/time expired&#8221;</a></li><li>August 26, 2009 -- <a href="http://itechlog.com/wordpress/2009/08/26/wordpress-media-upload-http-error/" title="Wordpress Media upload HTTP Error">Wordpress Media upload HTTP Error</a></li><li>May 13, 2009 -- <a href="http://itechlog.com/web-programming/2009/05/13/automatically-display-form-data-with-php/" title="Automatically display form data with PHP">Automatically display form data with PHP</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></ul>]]></content:encoded>
			<wfw:commentRss>http://itechlog.com/web-programming/2011/01/31/it-is-not-safe-to-rely-on-the-systems-timezone-settings/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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[<a href="http://itechlog.com/web-programming/2009/05/13/automatically-display-form-data-with-php/" title="Automatically display form data with PHP"></a>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 &#8230;<p class="read-more"><a href="http://itechlog.com/web-programming/2009/05/13/automatically-display-form-data-with-php/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://itechlog.com/web-programming/2009/05/13/automatically-display-form-data-with-php/" title="Automatically display form data with PHP"></a><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>

<!-- 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>November 7, 2011 -- <a href="http://itechlog.com/programming/2011/11/07/arduino-the-open-source-hardware/" title="Arduino the Open Source hardware">Arduino the Open Source hardware</a></li><li>August 10, 2011 -- <a href="http://itechlog.com/code-snipets/2011/08/10/cardsave-error-transaction-datetime-expired/" title="Cardsave error &#8220;transaction date/time expired&#8221;">Cardsave error &#8220;transaction date/time expired&#8221;</a></li><li>January 31, 2011 -- <a href="http://itechlog.com/web-programming/2011/01/31/it-is-not-safe-to-rely-on-the-systems-timezone-settings/" title="It is not safe to rely on the system’s timezone settings">It is not safe to rely on the system’s timezone settings</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></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>

