<?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>Peep in my mind &#187; notes</title>
	<atom:link href="http://peepinmymind.com/tag/notes/feed/" rel="self" type="application/rss+xml" />
	<link>http://peepinmymind.com</link>
	<description>...</description>
	<lastBuildDate>Sun, 30 May 2010 16:13:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>Numbers</title>
		<link>http://peepinmymind.com/web/2009/06/numbers/</link>
		<comments>http://peepinmymind.com/web/2009/06/numbers/#comments</comments>
		<pubDate>Thu, 11 Jun 2009 05:07:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Php]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[notes]]></category>
		<category><![CDATA[numbers]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Doing math in php $variable = value * value $variable = value + value $variable = value &#8211; value $variable = value / value Formatting Numbers Rounding numbers &#8211; rounds values to specified decimal places. It can be number or variables. There is an option that allow users to round too the number of decimal [...]]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-139" title="php101" src="http://peepinmymind.com/wp-content/uploads/2009/04/php101.gif" alt="php101" width="550" height="270" /><br />
Doing math in php</p>
<p>$variable = value * value<br />
$variable = value + value<br />
$variable = value &#8211; value<br />
$variable = value / value</p>
<p><strong>Formatting Numbers</strong></p>
<p>Rounding numbers &#8211; rounds values to specified decimal places. It  can be number or variables.  There is an option that allow users to round too the number of decimal places.</p>
<p>Example:<br />
round (6.20); = 6<br />
round (6.369, 2); = 6.37<br />
$number = 694.2783;<br />
round ($number); = 694</p>
<p>Number format &#8211; works like round but adds commas in the to numbers.<br />
number_format (6.2243, 2); = 6.22<br />
number_format (69, 2); = 69.00<br />
number_format (123456789); = 123,456,789</p>
<p><strong>Precedence </strong>- the order in which calculations are made.</p>
<p>8 &#8211; 4 / 2 = 6 and not 2 because division comes first.</p>
<p>To avoid this use ()<br />
(8 &#8211; 4) /2 ) = 2<br />
8 &#8211; (4 / 2 ) = 6</p>
<p>Incrementing and decrementing a number add or subtracts 1 value<br />
$var++; or $var&#8211;; this will give the value +1 or -1 effect.</p>
<p><strong>Creating random numbers</strong></p>
<p>rand()</p>
<p>$n = rand();- this generate random number<br />
$n = rand(0,100); &#8211; this generate random number 0 to 100</p>
<p>Other types are getrandmax() &#8211; get height random number<br />
mt_rand() &#8211; it suppose to work better then rand and great for cryptography.</p>
<p>These notes are from  <a href="http://www.amazon.com/gp/product/0321442490?ie=UTF8&amp;tag=booofdea-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0321442490">PHP for the World Wide Web, Third Edition (Visual QuickStart Guide)</a><img style="border:none !important; margin:0px !important;" src="http://www.assoc-amazon.com/e/ir?t=booofdea-20&amp;l=as2&amp;o=1&amp;a=0321442490" border="0" alt="" width="1" height="1" /> written by Larry Ullman. In order to make sense of my notes you should pruchase the PHP book its very well written and easy to follow.</p>
]]></content:encoded>
			<wfw:commentRss>http://peepinmymind.com/web/2009/06/numbers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating Forms with HTML and PHP</title>
		<link>http://peepinmymind.com/web/2009/06/creating-forms-with-html-and-php/</link>
		<comments>http://peepinmymind.com/web/2009/06/creating-forms-with-html-and-php/#comments</comments>
		<pubDate>Tue, 09 Jun 2009 21:06:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Php]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[notes]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Forms Code to generate forms goes between &#60;form&#62; data &#60;/form&#62; tags.  In the opening form tag also contains an action attribute.  This indicates which page the form data should submit. &#60;form action=&#8221;submit.php&#8221;&#62; There are two methods of transmitting data from the form to the handling script. They are GET and POST.  The GET method sends [...]]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-139" title="php101" src="http://peepinmymind.com/wp-content/uploads/2009/04/php101.gif" alt="php101" width="550" height="270" /></p>
<p><strong>Forms</strong></p>
<p>Code to generate forms goes between &lt;form&gt; data &lt;/form&gt; tags.  In the opening form tag also contains an action attribute.  This indicates which page the form data should submit.<br />
&lt;form action=&#8221;submit.php&#8221;&gt;</p>
<p>There are two methods of transmitting data from the form to the handling script. They are GET and POST.  The GET method sends all the gathered information along as part of the url. The Post method sends the data invisibly.</p>
<p>Example of the GET method.</p>
<p>http://www.blah.com/page.php?var=value&amp;blah&#8230;</p>
<p>Example of the POST method.</p>
<p>http://www.blah.com/page.php</p>
<p>Notes to keep in mind about GET method.</p>
<ul>
<li>GET method is limited amount of data that can be transferred.</li>
<li>Data can be view publicly which may cause security risk.</li>
<li>A page created by GET method can be bookmarked.</li>
<li>GET pages can be reloaded POST pages will have a confirmation box</li>
</ul>
<p>To used the form data submitted users need to use predefined variables.  They are $_GET and $_POST they are used based on which type of method is picked when generating the form.  If the method was post then use $_POST if the method was GET then use $_GET.  Also the variable must be typed with all caps cause it is case sensitive.</p>
<p>Sample code form.html</p>
<blockquote><p>&lt;body&gt;<br />
&lt;form action=&#8221;display_form.php&#8221; method=&#8221;post&#8221;&gt;<br />
&lt;p&gt;Comments: &lt;textarea name=&#8221;comments&#8221; rows=&#8221;3&#8243; cols=&#8221;30&#8243;&gt;&lt;/textarea&gt;&lt;/p&gt;<br />
&lt;input type=&#8221;submit&#8221; name=&#8221;submit&#8221; value=&#8221;Send Comment&#8221; /&gt;<br />
&lt;/form&gt;<br />
&lt;/body&gt;</p></blockquote>
<p>Sample code display_form.php</p>
<blockquote><p>&lt;body&gt;<br />
&lt;?php<br />
$comments = $_POST['comments'];<br />
print &#8220;&lt;p&gt;Thank you for the comment &lt;br /&gt;$comments&lt;/p&gt;&#8221;;<br />
?&gt;<br />
&lt;/body&gt;</p></blockquote>
<p>These notes are from  <a href="http://www.amazon.com/gp/product/0321442490?ie=UTF8&amp;tag=booofdea-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0321442490">PHP for the World Wide Web, Third Edition (Visual QuickStart Guide)</a><img style="border:none !important; margin:0px !important;" src="http://www.assoc-amazon.com/e/ir?t=booofdea-20&amp;l=as2&amp;o=1&amp;a=0321442490" border="0" alt="" width="1" height="1" /> written by Larry Ullman. In order to make sense of my notes you should pruchase the PHP book its very well written and easy to follow.</p>
]]></content:encoded>
			<wfw:commentRss>http://peepinmymind.com/web/2009/06/creating-forms-with-html-and-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Variable Notes</title>
		<link>http://peepinmymind.com/web/2009/06/php-variable-notes/</link>
		<comments>http://peepinmymind.com/web/2009/06/php-variable-notes/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 21:50:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Php]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[notes]]></category>
		<category><![CDATA[variable]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Variable &#8211; is like a magic box that stores information once the information is stored in the box it can be changed, or taken out to be displayed. All variable names must be have a dollar sign “$” at the start of the variable. After the dollar sign &#8220;$&#8221; the variable name must start with  [...]]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-139" title="php101" src="http://peepinmymind.com/wp-content/uploads/2009/04/php101.gif" alt="php101" width="550" height="270" /><br />
<strong></strong></p>
<p><strong>Variable</strong> &#8211; is like a magic box that stores information once the information is stored in the box it can be changed, or taken out to be displayed.</p>
<p>All variable names must be have a dollar sign “$” at the start of the variable.</p>
<p>After the dollar sign &#8220;$&#8221; the variable name must start with  a letter &#8220;A-Z&#8221; or &#8220;a-z&#8221; or a underscore &#8220;_&#8221; it cannot start with a number</p>
<p>After the “$” the rest of the name can be any combination of letters, numbers, and underscores.</p>
<p>Spaces can&#8217;t be used in variable names please use underscores “_” to represent spaces</p>
<p>Variable names are case sensitive so “$_cat” and “$_Cat” is different. (Try not to use variable with same names to reduce confusion).<br />
<strong><br />
Tips on creating variables</strong></p>
<ul>
<li>Always use lowercase on variable names</li>
<li>Always make your variable name descriptive</li>
<li>Always comment the purpose of the variables</li>
<li>Always try to defined all variables before use even though PHP doesn’t require it.</li>
</ul>
<p><strong>Variable Types</strong><br />
<strong></strong></p>
<p><strong>Numbers</strong></p>
<p>There are two types of numbers in PHP Integers and floating-point.  Integers are whole numbers that can be both positive or negatives but cannot have fractions of decimals.  Floating-point numbers are use to if numbers have decimal places.  (The only way to use fraction in PHP is to covert to decimals).</p>
<p>Integer = 1 or -1</p>
<p>Floating-point = 1.02 or -1.02</p>
<p><strong>Strings</strong></p>
<p>A string is any number of characters enclosed in single or double quotation marks &#8216;string&#8217; or &#8220;string&#8221;. Strings can be numbers letters symbols and spaces.  Stings can also contain variables. Strings can only contain 1 value.</p>
<p>To use quotation marks in a string use the backslash \.<br />
Example: &#8220;Yo, &#8220;ho ho!&#8221;" would have to be written &#8220;Yo, \&#8221;hoho!\&#8221;" in order for it to display properly.</p>
<p>Different quotation marks can be used to fix the problem.<br />
Example: &#8220;Yo, &#8216;ho ho!&#8217;&#8221; or &#8216;Yo, &#8220;ho ho!&#8221;&#8216;.</p>
<p><strong>Arrays</strong></p>
<p>Arrays can contain a list of values so users can put multiple strings and numbers in to one array.</p>
<p>Array uses keys to create and retrieve that values stored. Php has two different types of arrays. An “Indexed array” uses numbers for its keys. An “Associative array” uses strings for its keys.  An array containing other arrays is called a “multidimensional array”.</p>
<p><strong>Assigning Values to Variables</strong></p>
<p>To assign a value to a variable the user must use the = sign.  The equal sign is called the “assignment operator” because it assigns a value to the variable.</p>
<p>Variable assignment operator value<br />
$string = &#8220;Yo Ho!&#8221;;<br />
<strong><br />
Differences between Quotation marks &#8216;/&#8221;</strong></p>
<p>Single quotation marks &#8221; are treated literally<br />
Double Quotation marks take the value of the variable.</p>
<p>These notes are from  <a href="http://www.amazon.com/gp/product/0321442490?ie=UTF8&amp;tag=booofdea-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0321442490">PHP for the World Wide Web, Third Edition (Visual QuickStart Guide)</a><img style="border:none !important; margin:0px !important;" src="http://www.assoc-amazon.com/e/ir?t=booofdea-20&amp;l=as2&amp;o=1&amp;a=0321442490" border="0" alt="" width="1" height="1" /> written by Larry Ullman. In order to make sense of my notes you should pruchase that excellent PHP book its very well written and easy to follow.</p>
]]></content:encoded>
			<wfw:commentRss>http://peepinmymind.com/web/2009/06/php-variable-notes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP 101</title>
		<link>http://peepinmymind.com/web/2009/04/php-101/</link>
		<comments>http://peepinmymind.com/web/2009/04/php-101/#comments</comments>
		<pubDate>Fri, 17 Apr 2009 06:32:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Php]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[echo]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[learn]]></category>
		<category><![CDATA[notes]]></category>
		<category><![CDATA[print]]></category>
		<category><![CDATA[printf]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[I started to pick up PHP and started reading this book PHP for the World Wide Web, Third Edition (Visual QuickStart Guide) written by Larry Ullman. Like any good student I like to make notes when I read then type it out mainly just so I can review what I just learned. (yeah it sound [...]]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-139" title="php101" src="http://peepinmymind.com/wp-content/uploads/2009/04/php101.gif" alt="php101" width="550" height="270" /></p>
<p>I started to pick up PHP and started reading this book <a href="http://www.amazon.com/gp/product/0321442490?ie=UTF8&amp;tag=booofdea-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0321442490">PHP for the World Wide Web, Third Edition (Visual QuickStart Guide)</a><img style="border:none !important; margin:0px !important;" src="http://www.assoc-amazon.com/e/ir?t=booofdea-20&amp;l=as2&amp;o=1&amp;a=0321442490" border="0" alt="" width="1" height="1" /> written by Larry Ullman. Like any good student I like to make notes when I read then type it out mainly just so I can review what I just learned. (yeah it sound geeky but oh well only way i can learn) and since coding has never been my best subject I really do need to type it out over and over again. Anyways I figured I might as well keep my notes on my blog and share with you all. So if your reading my blog and trying to use my notes you should pick up the book too and follow along!</p>
<p><strong>Definition of PHP</strong></p>
<p>originally stood for <strong>Personal Home Page</strong> but it later changed and it now currently stands for <strong>Hypertext Preprocessor</strong></p>
<ul>
<li>php is an HTML embedded scripting language</li>
<li>php server side language</li>
<li>php allows users to create dyanmic pages</li>
<li>can run only on Php enabled web servers.</li>
</ul>
<p><strong>Basic PHP Syntax</strong></p>
<ul>
<li>PHP scripts should be save as a <em>.php</em> file</li>
<li>place php code within <strong>&lt;?</strong> <em>php code </em><strong>?&gt;</strong> tags</li>
<li>open &#8220;<strong>&lt;?</strong>php&#8221;</li>
<li>closed &#8220;<strong>?&gt;</strong>&#8220;</li>
<li>php statements must end with &#8220;<strong>;</strong>&#8221; or error will occur.</li>
</ul>
<p><strong>Function</strong></p>
<ul>
<li>Functions in php are followed by parentheses () in which arguments are passed to the function.</li>
<li>php is case-insensitive when calling functions (variables are case sensitive in php).</li>
</ul>
<p><strong>Function: phpinfo()</strong></p>
<ul>
<li>this function list the spec of the php install on the sever</li>
<li>this is also a great way to test if php was installed properly on the server</li>
</ul>
<p><strong>Example : </strong></p>
<blockquote><p>&lt;?php</p>
<p>// Show all information, defaults to INFO_ALL</p>
<p>phpinfo();</p>
<p>// Show just the module information.</p>
<p>// phpinfo(8) yields identical results.</p>
<p>phpinfo(INFO_MODULES);</p>
<p>?&gt;</p></blockquote>
<p><strong>Function: print()</strong></p>
<ul>
<li>use to display text or Output a string</li>
<li>strings must be surrounded with &#8221; &#8221; numbers don&#8217;t.</li>
</ul>
<p><strong>Example:</strong></p>
<blockquote><p>&lt;?php print (&#8220;Hello World&#8221;) ?&gt;</p></blockquote>
<p><strong>Function: echo()</strong></p>
<ul>
<li>use to Output one or more strings</li>
</ul>
<p><strong>Example:</strong></p>
<blockquote><p>&lt;?php echo (&#8220;Hello World&#8221;) ?&gt;</p></blockquote>
<p><strong>Function: printf()</strong></p>
<ul>
<li>use to Output one or more strings</li>
</ul>
<p><strong>Example:</strong></p>
<blockquote><p>&lt;?php printf (&#8220;Hello World&#8221;) ?&gt;</p></blockquote>
<p>To find more functions go to <a href="http://php.net/manual">php.net./manual</a></p>
]]></content:encoded>
			<wfw:commentRss>http://peepinmymind.com/web/2009/04/php-101/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
