<?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>JPennington.net&#187; PHP</title>
	<atom:link href="http://www.jpennington.net/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jpennington.net</link>
	<description>The online ramblings of a web programmer</description>
	<lastBuildDate>Mon, 15 Feb 2010 01:32:16 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Microsoft Web Platform</title>
		<link>http://www.jpennington.net/2009/07/20/microsoft-web-platform/</link>
		<comments>http://www.jpennington.net/2009/07/20/microsoft-web-platform/#comments</comments>
		<pubDate>Mon, 20 Jul 2009 16:15:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Cool Stuff]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[actual software]]></category>
		<category><![CDATA[compilation]]></category>
		<category><![CDATA[development server]]></category>
		<category><![CDATA[entire web]]></category>
		<category><![CDATA[internet information server]]></category>
		<category><![CDATA[microsoft software]]></category>
		<category><![CDATA[microsoft web]]></category>
		<category><![CDATA[spare time]]></category>
		<category><![CDATA[sql server express]]></category>
		<category><![CDATA[time projects]]></category>
		<category><![CDATA[virtual machine]]></category>
		<category><![CDATA[visual web developer]]></category>
		<category><![CDATA[visual web developer express]]></category>
		<category><![CDATA[web application]]></category>
		<category><![CDATA[web applications]]></category>
		<category><![CDATA[web developer express]]></category>
		<category><![CDATA[web microsoft]]></category>
		<category><![CDATA[web platform]]></category>
		<category><![CDATA[web server]]></category>
		<category><![CDATA[windows computers]]></category>

		<guid isPermaLink="false">http://www.jpennington.net/?p=251</guid>
		<description><![CDATA[You may already know this, or you may not.  However Microsoft really wants you to develop your websites to run on Windows.  Especially if you are an amateur developer.  So much so that they are willing to give you versions of some of their most expensive software for free.  They must figure that if you [...]]]></description>
			<content:encoded><![CDATA[<p>You may already know this, or you may not.  However Microsoft really wants you to develop your websites to run on Windows.  Especially if you are an amateur developer.  So much so that they are willing to give you versions of some of their most expensive software for free.  They must figure that if you use Microsoft software for your spare time projects you will need to use it professionally.<br />
<span id="more-251"></span><br />
Microsoft has a put a bundle together for anyone to download for free on their Windows computers called the Microsoft Web Platform.  It is a compilation of popular web applications, the .Net Framework, Internet Information Server (IIS), SQL Server Express, Visual Web Developer Express, and a bunch of extras (Including PHP for Windows).  With these tools you can make just about any web application you could ever want.  This is a great way to get a development server up and running on your computer without the need to have a virtual machine of buy tons of software.</p>
<p>Persoanlly, I think it would be better to have a virtual machine running all the actual software your live hosting enviroment will have, but this is still a great way to get started without the compleixty of having to run an entire web server.</p>
<p>You can download the Microsoft Web Platform from: <a href="http://www.microsoft.com/web/">http://www.microsoft.com/web/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jpennington.net/2009/07/20/microsoft-web-platform/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Ultimate PHP CSV Parser</title>
		<link>http://www.jpennington.net/2009/02/03/the-ultimate-csv-parser/</link>
		<comments>http://www.jpennington.net/2009/02/03/the-ultimate-csv-parser/#comments</comments>
		<pubDate>Wed, 04 Feb 2009 00:50:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[csv]]></category>
		<category><![CDATA[csv parsing]]></category>
		<category><![CDATA[parse]]></category>

		<guid isPermaLink="false">http://www.jpennington.net/?p=176</guid>
		<description><![CDATA[Lately I have been trying to find cool PHP utilities that I can use to handle my day to day tasks.  Lately parsing CSV files in PHP has been something I have had to do over and over again.  Such a basic task can be such a pain considering all of the different formats that [...]]]></description>
			<content:encoded><![CDATA[<p>Lately I have been trying to find cool PHP utilities that I can use to handle my day to day tasks.  Lately parsing CSV files in PHP has been something I have had to do over and over again.  Such a basic task can be such a pain considering all of the different formats that they can be in (mostly the quotes around some of the values). I would do find and replace on the file to remove all the extra stuff and hope that I did not corrupt the data.<span id="more-176"></span></p>
<p>There had to be a better way to do this.  I did some searching and I found Ming Hong Ng&#8217;s CSV Parsing class.  It worked perfectly.  I have parsed a ton of CSV files with no problems at all.  You can download this class from: http://minghong.blogspot.com/2006/07/csv-parser-for-php.html</p>
<p>It is so simple to use too!  Simply create an instance and call ParseFromFile or ParseFromString.  The data is stored in the data instance variable.  So simple!</p>
<p>This is something that should be apart of any PHP programmers toolkit.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jpennington.net/2009/02/03/the-ultimate-csv-parser/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>dBug.  Awesome PHP Debugger</title>
		<link>http://www.jpennington.net/2009/02/01/dbug-awesome-php-debugger/</link>
		<comments>http://www.jpennington.net/2009/02/01/dbug-awesome-php-debugger/#comments</comments>
		<pubDate>Sun, 01 Feb 2009 19:00:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[dbug]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[debugger]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.jpennington.net/?p=156</guid>
		<description><![CDATA[I just ran into this awesome PHP class called dBug.  It works like print_r, but does so much more.  You can expand and collapse anything in the structure you use it with.  You know no idea how nice this will be to parse large data structures with.  So nice.  Check it out at: http://dbug.ospinto.com/
]]></description>
			<content:encoded><![CDATA[<p>I just ran into this awesome PHP class called dBug.  It works like print_r, but does so much more.  You can expand and collapse anything in the structure you use it with.  You know no idea how nice this will be to parse large data structures with.  So nice.  Check it out at: http://dbug.ospinto.com/</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jpennington.net/2009/02/01/dbug-awesome-php-debugger/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ajax with jQuery</title>
		<link>http://www.jpennington.net/2009/01/31/ajax-with-jquery/</link>
		<comments>http://www.jpennington.net/2009/01/31/ajax-with-jquery/#comments</comments>
		<pubDate>Sat, 31 Jan 2009 19:00:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[instructions]]></category>
		<category><![CDATA[jquery ajax]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.jpennington.net/?p=139</guid>
		<description><![CDATA[Here is the code we are using for today&#8217;s discussion on using jQuery to add Ajax to a website.  You can download a copy of everything required to do this project here.

Today&#8217;s example utilizes the PHP Calendar object I recently released along with a Javascript library called jQuery.  We will generate a calendar [...]]]></description>
			<content:encoded><![CDATA[<p>Here is the code we are using for today&#8217;s discussion on using jQuery to add Ajax to a website.  You can download a copy of everything required to do this project <a href="http://www.jpennington.net/resources/php/ajax_calendar.zip">here</a>.<br />
<span id="more-139"></span><br />
Today&#8217;s example utilizes the PHP Calendar object I recently released along with a Javascript library called jQuery.  We will generate a calendar that will be able to switch month and years using Ajax.</p>
<h2>What is Ajax?</h2>
<p>Ajax is a way to call back to the webserver without refreshing the entire page.  This is done through Javascript.  There is a very lengthy discussion I could have with you about this, but there are better <a href="http://en.wikipedia.org/wiki/AJAX">resources</a> out there about how it actually works.  All you really need to know is that you can use it to call back to the webserver to do whatever you want to.  It can be used to add an item to a shopping cart or update a certain part of the page to streamline a process.</p>
<h2>On To The Code</h2>
<p>I am going to assume you know how the calendar object works.  If not please read the PHP Calendar Instructions Page.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?</span>
<span style="color: #666666; font-style: italic;">// Import the PHP Calendar Object</span>
<span style="color: #b1b100;">require_once</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'object.calendar.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'action'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">switch</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'action'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'ajax_generate'</span><span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$month</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'month'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$year</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'year'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$calendar</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Calendar<span style="color: #009900;">&#40;</span><span style="color: #000088;">$month</span><span style="color: #339933;">,</span> <span style="color: #000088;">$year</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$next_month</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$calendar</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getNextMonthYear</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$previous_month</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$calendar</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getPreviousMonthYear</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$calendar</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setNextMonthContent</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&lt;a href=&quot;javascript:ajaxChangeCalendar('</span><span style="color: #339933;">.</span><span style="color: #000088;">$next_month</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'month'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">', '</span><span style="color: #339933;">.</span><span style="color: #000088;">$next_month</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'year'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">')&quot;&gt; &gt; &lt;/a&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$calendar</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setPreviousMonthContent</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&lt;a href=&quot;javascript:ajaxChangeCalendar('</span><span style="color: #339933;">.</span><span style="color: #000088;">$previous_month</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'month'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">', '</span><span style="color: #339933;">.</span><span style="color: #000088;">$previous_month</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'year'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">')&quot;&gt; &lt; &lt;/a&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$calendar</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">generate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #990000;">exit</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;html&gt;
&lt;head&gt;
	&lt;script type=&quot;text/javascript&quot; src=&quot;jquery.js&quot;&gt;&lt;/script&gt;
&lt;/head&gt;
&nbsp;
&lt;body&gt;
&nbsp;
	&lt;div id=&quot;calendar_group&quot;&gt;
		<span style="color: #000000; font-weight: bold;">&lt;?</span>
		<span style="color: #000088;">$month</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$year</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">2009</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$calendar</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Calendar<span style="color: #009900;">&#40;</span><span style="color: #000088;">$month</span><span style="color: #339933;">,</span> <span style="color: #000088;">$year</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$next_month</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$calendar</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getNextMonthYear</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$previous_month</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$calendar</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getPreviousMonthYear</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$calendar</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setNextMonthContent</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&lt;a href=&quot;javascript:ajaxChangeCalendar('</span><span style="color: #339933;">.</span><span style="color: #000088;">$next_month</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'month'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">', '</span><span style="color: #339933;">.</span><span style="color: #000088;">$next_month</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'year'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">')&quot;&gt; &gt; &lt;/a&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$calendar</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setPreviousMonthContent</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&lt;a href=&quot;javascript:ajaxChangeCalendar('</span><span style="color: #339933;">.</span><span style="color: #000088;">$previous_month</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'month'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">', '</span><span style="color: #339933;">.</span><span style="color: #000088;">$previous_month</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'year'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">')&quot;&gt; &lt; &lt;/a&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$calendar</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">generate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">?&gt;</span>
	&lt;/div&gt;
	<span style="color: #000000; font-weight: bold;">&lt;?</span>
	<span style="color: #000088;">$current_month</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$calendar</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getCurrentMonthYear</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">?&gt;</span>
	&lt;a href=&quot;javascript:ajaxChangeCalendar(<span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$current_month</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'month'</span><span style="color: #009900;">&#93;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>, <span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$current_month</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'year'</span><span style="color: #009900;">&#93;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>)&quot;&gt;Current Month&lt;/a&gt;
	&lt;br/&gt;&lt;br/&gt;
	&lt;select name=&quot;move_to_month&quot; id=&quot;move_to_month&quot;&gt;
		<span style="color: #000000; font-weight: bold;">&lt;?</span>
		<span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">&lt;=</span><span style="color: #cc66cc;">12</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;option value=&quot;<span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$i</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$i</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/option&gt;<span style="color: #000000; font-weight: bold;">&lt;?</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #000000; font-weight: bold;">?&gt;</span>
	&lt;/select&gt;
	&lt;select name=&quot;move_to_year&quot; id=&quot;move_to_year&quot;&gt;
		<span style="color: #000000; font-weight: bold;">&lt;?</span>
		<span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">1900</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">&lt;=</span><span style="color: #cc66cc;">2020</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;option value=&quot;<span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$i</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?=</span><span style="color: #000088;">$i</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/option&gt;<span style="color: #000000; font-weight: bold;">&lt;?</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #000000; font-weight: bold;">?&gt;</span>
	&lt;/select&gt;
	&lt;input type=&quot;button&quot; value=&quot;Go To&quot; onclick=&quot;ajaxChangeCalendar( document.getElementById('move_to_month').value, document.getElementById('move_to_year').value )&quot; /&gt;
	&lt;script type=&quot;text/javascript&quot;&gt;
		function ajaxChangeCalendar( month, year ) {
			var redraw = $.ajax({
							type: &quot;POST&quot;,
							async: false,
							url: &quot;ajax_calendar.php&quot;,
							data: &quot;action=ajax_generate&amp;month=&quot; + month + &quot;&amp;year=&quot;+year
						}).responseText;
			$(&quot;#calendar_group&quot;).html(redraw);
		}
	&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;</pre></td></tr></table></div>

<p>The first thing I am going to bring your attention to is including the jQuery library on line 22.  So as you can see we are generating a calendar on lines 29-36.  The Next and Previous Month Content.  What we are going to put in there is a link that calls a Javascript function called ajaxChangeCalendar.You will also notice that we call this function on lines 42 and 59.  Line 42 moves the calendar to the current month and year, while the button on line 59 uses the values from the dropdown menu to determine where to go.</p>
<p>Now for the meat and potatoes of Ajax, the ajaxChangeCalendar function.  You will notice that we are utilizing jQuery&#8217;s Ajax functionality.  We set the type to Post (It could easily be Get if you wanted to), async is set to false, set the URL and the data that should be put into POST.  The $.ajax will do all the work for you.  It reaches out and takes the text it received and puts it into the variable redraw.</p>
<p>We then take that text and use replace the HTML in the calendar_group div with the value of redraw.</p>
<p>That seems simple right?  It really is.  Now let&#8217;s talk about how we get the data that goes into redraw.  This can be found on lines 4-18.  You will notice that it looks exactly the same as the code that generated the calendar initially, except for the fact that the month and possibly year have changed.  What is happening is that you are outputting the HTML code that will replace the HTML in the calendar_group div.</p>
<p>Also, notice the exit() being called on line 15.  We do not want any more HTML to output after the table.  Otherwise you will have the entire page put into the value of redraw and that will in turn redraw the entire page.  That would defeat the purpose of Ajax in the first place.</p>
<p>Anyways, I hope this helps to explain how you can use jQuery to put Ajax on your site.  This was a very simple example but you can do a whole lot more with Ajax if you put your mind to it.  If you have any questions post a comment or submit it in the contact form.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jpennington.net/2009/01/31/ajax-with-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Calendar Instructions Updated</title>
		<link>http://www.jpennington.net/2009/01/28/php-calendar-instructions-updated/</link>
		<comments>http://www.jpennington.net/2009/01/28/php-calendar-instructions-updated/#comments</comments>
		<pubDate>Wed, 28 Jan 2009 23:15:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.jpennington.net/?p=137</guid>
		<description><![CDATA[The instructions for how to use the PHP Calendar class have been released.  Take a look and contact me if you have any questions.
]]></description>
			<content:encoded><![CDATA[<p>The instructions for how to use the PHP Calendar class have been released.  Take a look and contact me if you have any questions.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jpennington.net/2009/01/28/php-calendar-instructions-updated/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Authorize.net Instructions Loaded</title>
		<link>http://www.jpennington.net/2009/01/28/authorizenet-instructions-loaded/</link>
		<comments>http://www.jpennington.net/2009/01/28/authorizenet-instructions-loaded/#comments</comments>
		<pubDate>Wed, 28 Jan 2009 11:50:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.jpennington.net/?p=130</guid>
		<description><![CDATA[I have loaded the instructions for how to use the Authorize.net class.  You can access it on the right side of the site under Pages.  If anyone has questions about it make sure you ask them through the fancy new contact form that is also on the right.  Sorry about the CAPTCHA, but I just [...]]]></description>
			<content:encoded><![CDATA[<p>I have loaded the instructions for how to use the Authorize.net class.  You can access it on the right side of the site under Pages.  If anyone has questions about it make sure you ask them through the fancy new contact form that is also on the right.  Sorry about the CAPTCHA, but I just don&#8217;t want to try and shovel through the spam.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jpennington.net/2009/01/28/authorizenet-instructions-loaded/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Calendar Released</title>
		<link>http://www.jpennington.net/2009/01/26/php-calendar-released/</link>
		<comments>http://www.jpennington.net/2009/01/26/php-calendar-released/#comments</comments>
		<pubDate>Tue, 27 Jan 2009 00:54:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[php calendar]]></category>
		<category><![CDATA[release]]></category>

		<guid isPermaLink="false">http://www.jpennington.net/?p=107</guid>
		<description><![CDATA[I am releasing a class that generates Calendars.  I plan on doing an example of how to do Ajax with this class so I figured I would release it a little early so that people can play with it before I begin the example.  You can download it here.
]]></description>
			<content:encoded><![CDATA[<p>I am releasing a class that generates Calendars.  I plan on doing an example of how to do Ajax with this class so I figured I would release it a little early so that people can play with it before I begin the example.  You can download it <a href="/resources/php/php_calendar.zip">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jpennington.net/2009/01/26/php-calendar-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ternary Operator &#8211; Your Best Friend</title>
		<link>http://www.jpennington.net/2009/01/23/ternary-operator-your-best-friend/</link>
		<comments>http://www.jpennington.net/2009/01/23/ternary-operator-your-best-friend/#comments</comments>
		<pubDate>Sat, 24 Jan 2009 02:37:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[? operator]]></category>
		<category><![CDATA[inline if statement]]></category>
		<category><![CDATA[ternary]]></category>
		<category><![CDATA[ternary operatior]]></category>

		<guid isPermaLink="false">http://www.jpennington.net/?p=91</guid>
		<description><![CDATA[If you have never used the Ternary Operator, or ? operator, your life is about to change.  The ternary operator is used as a shorthand for if .. else structures that can really clean up your code.

Take this for example:
1.  if( $use_live_server ) {
2.    $url = "http://www.thelivesite.com"
3.  } else {
4.  [...]]]></description>
			<content:encoded><![CDATA[<p>If you have never used the Ternary Operator, or ? operator, your life is about to change.  The ternary operator is used as a shorthand for if .. else structures that can really clean up your code.<br />
<span id="more-91"></span><br />
Take this for example:</p>
<pre>1.  if( $use_live_server ) {
2.    $url = "http://www.thelivesite.com"
3.  } else {
4.    $url = "http://www.thedevsite.com";
5.  }</pre>
<p>This block of code sets which URL we want to connect to based on if a variable called $use_live_server.  While the block of code is perfectly valid, there is a much better way to do the exact same thing in a single line of code.</p>
<pre><span style="font-size: x-small;">1.  $url = $use_live_server ? "http://www.thelivesite.com" : "http://www.thedevsite.com";</span></pre>
<p>That one line of code does the exact same thing and once you understand how this works.  Here is how the ternary operator works:</p>
<pre>$variable = $expression_to_evaulate ? true : false</pre>
<p>You do not necessaryly have to have a variable that is true or false.  You can do any expression you need to.</p>
<p>So now that you know about the ternary operator, you can start using it and it will improve the quality of your code.  In the Authorize.net class you will notice this being used on line 41:</p>
<pre><span style="font-size: x-small;">$this-&gt;transact_url = AUTH_NET_USE_LIVE_API ? "https://secure.authorize.net/gateway/transact.dll" : "https://test.authorize.net/gateway/transact.dll";</span></pre>
<p>This line is setting the URL to connect to for the object based on the constant AUTH_NET_USE_LIVE_API.</p>
<p>If you have any questions about this go ahead and post a comment or contact me.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jpennington.net/2009/01/23/ternary-operator-your-best-friend/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP5 Class Structure</title>
		<link>http://www.jpennington.net/2009/01/23/php5-class-structure/</link>
		<comments>http://www.jpennington.net/2009/01/23/php5-class-structure/#comments</comments>
		<pubDate>Sat, 24 Jan 2009 02:36:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[php 5]]></category>
		<category><![CDATA[php 5 class]]></category>
		<category><![CDATA[php object]]></category>
		<category><![CDATA[php5]]></category>
		<category><![CDATA[php5 class]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.jpennington.net/?p=86</guid>
		<description><![CDATA[
PHP5 Class Structure
Classes are a very important aspect of good code. Organizing your code in classes makes the code reusable (even in other applications) and helps clearly separate the model from the view of the site. 

Components of a Class
Classes contain attributes and methods. The attributes are variables that describe the object and methods are [...]]]></description>
			<content:encoded><![CDATA[<p><!--[endif]--></p>
<p class="MsoNormal">PHP5 Class Structure</p>
<p class="MsoNormal">Classes are a very important aspect of good code.<span> </span>Organizing your code in classes makes the code reusable (even in other applications) and helps clearly separate the model from the view of the site.<span> </span></p>
<p><span id="more-86"></span></p>
<p class="MsoNormal">Components of a Class</p>
<p class="MsoNormal">Classes contain attributes and methods.<span> </span>The attributes are variables that describe the object and methods are functions that manipulate the object to accomplish various tasks.</p>
<p class="MsoNormal">For example, we could have a class for a Car.<span> </span>A car has a color, a maximum speed, a certain amount of seats, and tires.<span> </span>Each of those things could be an attribute for a Car class.</p>
<p class="MsoNormal">A Car can have its engine started and stopped, it can accelerate and slow down.<span> </span>These things could be represented as methods.<span> </span></p>
<p class="MsoNormal">A Class in PHP5</p>
<p class="MsoNormal">To create a Car class in PHP5 you would enter the following:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">class</span> Car <span style="color: #009900;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000088;">$color</span><span style="color: #339933;">;</span>
  <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000088;">$max_speed</span><span style="color: #339933;">;</span>
  <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000088;">$num_seats</span><span style="color: #339933;">;</span>
  <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000088;">$tires</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> __construct<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">color</span> <span style="color: #339933;">=</span> ‘Red’<span style="color: #339933;">;</span>
    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">max_speed</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">150</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">num_seats</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">4</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">tires</span> <span style="color: #339933;">=</span> ‘Radial’
  <span style="color: #009900;">&#125;</span>
  <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> accelerate<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #666666; font-style: italic;">// Accelerate The Car</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> brake<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #666666; font-style: italic;">// Push The Brake</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> start<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #666666; font-style: italic;">// Start The Engine</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> stop<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #666666; font-style: italic;">// Stop The Engine</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p class="MsoNormal">On line 1 we declare the class.<span> </span>In this example we have called the class Car, however we could have easily called it something else like Automobile.<span> </span></p>
<p class="MsoNormal">On lines 2-5 we declare the variables that are the attributes for the Car.<span> </span>You will notice that all the variables have the word private before them.<span> </span>This keeps the variables from being accessed of set from outside the object.<span> </span>You should get in the habit of setting your variables to private and creating functions to get and set them.<span> </span>While this seems like a lot of work it allows you to protect the data within your object.<span> </span>For example imagine we had a variable called engine_started.<span> </span>Suppose in our Class we were going down the road at 50 MPH.<span> </span>Now imagine we just set engine_started to false.<span> </span>It would stop the engine but keep us moving at 50 MPH.<span> </span>Not the best situation to be in.<span> </span>You want to be able to validate your information as it changes.</p>
<p class="MsoNormal">Line 6-11 declare the object constructor.<span> </span>The constructor is run when the object is created.<span> </span>In lines 7-10 you see that we are setting the attribute variables for the class.<span> </span>This is how you set and get items from within the class.<span> </span>$this represents the object that you are currently in.<span> </span></p>
<p class="MsoNormal"><span>Using The Class</span></p>
<p class="MsoNormal"><!--[if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:TrackMoves /> <w:TrackFormatting /> <w:PunctuationKerning /> <w:ValidateAgainstSchemas /> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:DoNotPromoteQF /> <w:LidThemeOther>EN-US</w:LidThemeOther> <w:LidThemeAsian>X-NONE</w:LidThemeAsian> <w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript> <w:Compatibility> <w:BreakWrappedTables /> <w:SnapToGridInCell /> <w:WrapTextWithPunct /> <w:UseAsianBreakRules /> <w:DontGrowAutofit /> <w:SplitPgBreakAndParaMark /> <w:DontVertAlignCellWithSp /> <w:DontBreakConstrainedForcedTables /> <w:DontVertAlignInTxbx /> <w:Word11KerningPairs /> <w:CachedColBalance /> </w:Compatibility> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> <m:mathPr> <m:mathFont m:val="Cambria Math" /> <m:brkBin m:val="before" /> <m:brkBinSub m:val="&#45;-" /> <m:smallFrac m:val="off" /> <m:dispDef /> <m:lMargin m:val="0" /> <m:rMargin m:val="0" /> <m:defJc m:val="centerGroup" /> <m:wrapIndent m:val="1440" /> <m:intLim m:val="subSup" /> <m:naryLim m:val="undOvr" /> </m:mathPr></w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"   DefSemiHidden="true" DefQFormat="false" DefPriority="99"   LatentStyleCount="267"> <w:LsdException Locked="false" Priority="0" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Normal" /> <w:LsdException Locked="false" Priority="9" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="heading 1" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9" /> <w:LsdException Locked="false" Priority="39" Name="toc 1" /> <w:LsdException Locked="false" Priority="39" Name="toc 2" /> <w:LsdException Locked="false" Priority="39" Name="toc 3" /> <w:LsdException Locked="false" Priority="39" Name="toc 4" /> <w:LsdException Locked="false" Priority="39" Name="toc 5" /> <w:LsdException Locked="false" Priority="39" Name="toc 6" /> <w:LsdException Locked="false" Priority="39" Name="toc 7" /> <w:LsdException Locked="false" Priority="39" Name="toc 8" /> <w:LsdException Locked="false" Priority="39" Name="toc 9" /> <w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption" /> <w:LsdException Locked="false" Priority="10" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Title" /> <w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font" /> <w:LsdException Locked="false" Priority="11" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Subtitle" /> <w:LsdException Locked="false" Priority="22" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Strong" /> <w:LsdException Locked="false" Priority="20" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Emphasis" /> <w:LsdException Locked="false" Priority="59" SemiHidden="false"    UnhideWhenUsed="false" Name="Table Grid" /> <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text" /> <w:LsdException Locked="false" Priority="1" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="No Spacing" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 1" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 1" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 1" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 1" /> <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision" /> <w:LsdException Locked="false" Priority="34" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="List Paragraph" /> <w:LsdException Locked="false" Priority="29" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Quote" /> <w:LsdException Locked="false" Priority="30" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Intense Quote" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 1" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 1" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 1" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 1" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 1" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 2" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 2" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 2" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name=<br />
"Medium Shading 2 Accent 2" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 2" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 2" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 2" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 2" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 2" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 2" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 3" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 3" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 3" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 3" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 3" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 3" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 3" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 3" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 3" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 4" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 4" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 4" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 4" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 4" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 4" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 4" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 4" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 4" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 5" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 5" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 5" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 5" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 5" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 5" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 5" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 5" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 5" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 6" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 6" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 6" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 6" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 6" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 6" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 6" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 6" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 6" /> <w:LsdException Locked="false" Priority="19" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis" /> <w:LsdException Locked="false" Priority<br />
="21" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis" /> <w:LsdException Locked="false" Priority="31" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference" /> <w:LsdException Locked="false" Priority="32" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Intense Reference" /> <w:LsdException Locked="false" Priority="33" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Book Title" /> <w:LsdException Locked="false" Priority="37" Name="Bibliography" /> <w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading" /> </w:LatentStyles> </xml><![endif]--> <!--[if gte mso 10]><br />
<mce:style><!   /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-priority:99; 	mso-style-qformat:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin-top:0in; 	mso-para-margin-right:0in; 	mso-para-margin-bottom:10.0pt; 	mso-para-margin-left:0in; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:"Times New Roman"; 	mso-fareast-theme-font:minor-fareast; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin;} --></p>
<p><!--[endif]--></p>
<p class="MsoNormal">Using a class in PHP is very simple.<span> </span>The first thing you have to do is create an instance of the object.<span> </span>That is done in the following syntax:</p>
<p class="MsoNormal">$car = new Car();</p>
<p class="MsoNormal">This creates a new instance of the Car class.<span> </span>It runs the constructor and sets all the variables.</p>
<p class="MsoNormal">To run the various methods in the class you use the following syntax:</p>
<p class="MsoNormal">$car-&gt;accelerate();</p>
<p class="MsoNormal">$car-&gt;brake();</p>
<p class="MsoNormal">$car-&gt;start();</p>
<p class="MsoNormal">$car-&gt;stop() ;</p>
<p class="MsoNormal">One thing you cannot do is get the Car’s instance variables.<span> </span>You will have to create functions to get and set the values in order to do this.</p>
<p class="MsoNormal">If you are a regular reader of the site you will notice that this post replaced a post about objects and classes.  I hope that this will be an improvement over the last iteration.  I will continue to update this post as I can in order to improve the information.</p>
<p class="MsoNormal">If you have any questions post a comment and I will do my best to get back to you as soon as possible.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jpennington.net/2009/01/23/php5-class-structure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>cURL to Connect To Another System</title>
		<link>http://www.jpennington.net/2009/01/23/curl-to-connect-to-another-system/</link>
		<comments>http://www.jpennington.net/2009/01/23/curl-to-connect-to-another-system/#comments</comments>
		<pubDate>Sat, 24 Jan 2009 02:34:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[connection]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[integrating]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.jpennington.net/?p=96</guid>
		<description><![CDATA[cURL is a very useful tool used to progmatically connect and interact with other systems to do various tasks like download a Web Page or RSS feed.  It is also used to send information to another computer and get a response.

1. $ch = curl_init($url);
2. curl_setopt($ch, CURLOPT_HEADER, 0);
3. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
4. curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);
5. $result = [...]]]></description>
			<content:encoded><![CDATA[<p>cURL is a very useful tool used to progmatically connect and interact with other systems to do various tasks like download a Web Page or RSS feed.  It is also used to send information to another computer and get a response.<br />
<span id="more-96"></span></p>
<pre>1. $ch = curl_init($url);
2. curl_setopt($ch, CURLOPT_HEADER, 0);
3. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
4. curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);
5. $result = curl_exec ($ch);</pre>
<p>These 5 lines of code do a lot.  In line 1 you begin creating your transaction by calling curl_init() and passing the URL you want to connect to (in this case we have a variable called $url).</p>
<p>Lines 2-4 set different options for the transaction.  The CURLOPT_HEADER option is set to zero to signify we do not want the header information in the response. CURLOPT_RETURNTRANSFER tells cURL to assign the data we receive to a variable rather than simply output it to the screen.  CURLOPT_POSTFIELDS sets what data we want to send in the header of our request. This is a very important option when interacting with other systems as this is generally where you will put your XML or other header data that is required by the system you are connecting with.</p>
<p>Line 5 actually executes the request.  It will reach out to the $url, with $fields in the POST areas of varaibles and putting the data we received into the variable $result.</p>
<p>You can now process the data in whatever way you need to for your application.  In the Authorize.net class the data gets passed to the parse_response() function to format the data in such a way that we can easily work with it.</p>
<p>If you have any questions about cURL post a comment and I will answer to the best of my ability.  To read more about cURL you can refer to the PHP documentation <a href="http://us3.php.net/manual/en/book.curl.php" target="_blank">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jpennington.net/2009/01/23/curl-to-connect-to-another-system/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	<img style='margin:0;padding:0;border:0;' width='1px' height='1px' src="http://www.jpennington.net/wp-content/plugins/mystat/mystat.php?act=time_load&id=52249&rnd=543581881" /></channel>
</rss>
