<?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"
	>

<channel>
	<title>Joe Bivins</title>
	<atom:link href="http://joebivins.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://joebivins.com</link>
	<description>Web Developer, Wesley Chapel, FL</description>
	<pubDate>Sat, 08 Nov 2008 20:50:06 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
	<language>en</language>
			<item>
		<title>Scheduled Wordpress Post Problems</title>
		<link>http://joebivins.com/2008/11/08/scheduled-wordpress-post-problems/</link>
		<comments>http://joebivins.com/2008/11/08/scheduled-wordpress-post-problems/#comments</comments>
		<pubDate>Sat, 08 Nov 2008 18:30:15 +0000</pubDate>
		<dc:creator>joe.bivins</dc:creator>
		
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://joebivins.com/?p=350</guid>
		<description><![CDATA[Wordpress features a plug-in known has Akismet, which filters out unwanted comments.  There are programs running loose in the wild whose sole purpose is to inject comments into blogs that link to other websites.  The mentioned plug-in filters out the unwanted comments, spam, from wanted human comments, referred to as ham.
A useful article [...]]]></description>
			<content:encoded><![CDATA[<p>Wordpress features a plug-in known has Akismet, which filters out unwanted comments.  There are programs running loose in the wild whose sole purpose is to inject comments into blogs that link to other websites.  The mentioned plug-in filters out the unwanted comments, spam, from wanted human comments, referred to as ham.</p>
<p>A useful article <a href='http://ocaoimh.ie/2008/07/03/more-ways-to-stop-spammers-and-unwanted-traffic'>here</a> which provides additional tactics for removing unwanted traffic.  However, one of their tactics to thwart unwanted traffic removes the ability to schedule future blog posts in Wordpress should your server&#8217;s ip address change, as scheduled post will never publish when their scheduled time arrives.  Manually running wp-cron.php didn&#8217;t publish the overdue posts.  I tracked down the problem to the following htaccess rule. </p>
<pre name="code" class="xml">

RewriteCond %{HTTP_REFERER} ^$
RewriteCond %{HTTP_USER_AGENT} ^$
RewriteCond %{REMOTE_ADDR} !^72\.47\.224\.86$
RewriteRule ^(.*) - [F]
</pre>
<p>The above rewrite condition prohibits traffic from sources that don&#8217;t use a web browser unless it originates from the web server.  The web server&#8217;s ip address is hard-wired in the rule.  This works fine unless your web server&#8217;s ip address changes, and this is what happened with my web host.</p>
<p>Any scheduled post due for publishing remained forever scheduled.  Correcting this problem involves changing the ip address mentioned in the above rewrite rule to the server&#8217;s current ip address or remove the rewrite rule entirely, relying solely on Akismet to filter the spam that unwanted traffic may leave.</p>
]]></content:encoded>
			<wfw:commentRss>http://joebivins.com/2008/11/08/scheduled-wordpress-post-problems/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Saving My 15 Cents Worth</title>
		<link>http://joebivins.com/2008/11/06/saving-my-15-cents-worth/</link>
		<comments>http://joebivins.com/2008/11/06/saving-my-15-cents-worth/#comments</comments>
		<pubDate>Thu, 06 Nov 2008 23:24:56 +0000</pubDate>
		<dc:creator>joe.bivins</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://joebivins.com/?p=345</guid>
		<description><![CDATA[I received a bill for a credit card that I never use in the mail today.  Oddly, there is a charge in the amount of $0.15 from a CENTR LIMITED located in Texas.  From speaking with the credit card company this is an office supply store.  Centr Limited’s phone number is no [...]]]></description>
			<content:encoded><![CDATA[<p>I received a bill for a credit card that I never use in the mail today.  Oddly, there is a charge in the amount of $0.15 from a CENTR LIMITED located in Texas.  From speaking with the credit card company this is an office supply store.  Centr Limited’s phone number is no longer in service.</p>
<p>More information about the disconnected phone number can be found <a href='http://800notes.com/Phone.aspx/1-888-560-6635/1'>here</a>.</p>
<p>Fortunately, the charge was easily disputed.  Now, it&#8217;s time to cancel my unused credit card.</p>
]]></content:encoded>
			<wfw:commentRss>http://joebivins.com/2008/11/06/saving-my-15-cents-worth/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Shared Hosting</title>
		<link>http://joebivins.com/2008/10/13/shared-hosting/</link>
		<comments>http://joebivins.com/2008/10/13/shared-hosting/#comments</comments>
		<pubDate>Mon, 13 Oct 2008 05:35:48 +0000</pubDate>
		<dc:creator>joe.bivins</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://joebivins.com/?p=334</guid>
		<description><![CDATA[I spent a good part of my weekend moving websites to another web hosting company.  As with using cheap shared hosting you get what you pay for.  The speed was okay but more often that I&#8217;d like the server went offline for one reason or another.  Perhaps, I was on a bad, [...]]]></description>
			<content:encoded><![CDATA[<p>I spent a good part of my weekend moving websites to another web hosting company.  As with using cheap shared hosting you get what you pay for.  The speed was okay but more often that I&#8217;d like the server went offline for one reason or another.  Perhaps, I was on a bad, malfunctioning server; I don&#8217;t know.  For the forth or fifth time, the server took a nosedive.  This time around the hard-drives went into &#8220;read-only&#8221; mode for several hours on Saturday morning forcing all websites on that server offline.</p>
<p>Since I sit near other web developers (exchange software engineers or internet application developers as seen fit) at work, it is easy to get a recommendation for alternative web hosting companies.  The host that I migrated everything to uses a grid-server.  People share resources, but instead of using one server this uses an array of servers.  If one server goes down, it somehow uses another server that is online.</p>
<p>This costs about twice as much to use as my previous host, but this should be an improvement.  If I don&#8217;t complain assume it is.</p>
]]></content:encoded>
			<wfw:commentRss>http://joebivins.com/2008/10/13/shared-hosting/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Setting Up a Web Development Environment</title>
		<link>http://joebivins.com/2008/09/21/setting-up-a-web-environment/</link>
		<comments>http://joebivins.com/2008/09/21/setting-up-a-web-environment/#comments</comments>
		<pubDate>Sun, 21 Sep 2008 22:39:45 +0000</pubDate>
		<dc:creator>joe.bivins</dc:creator>
		
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://joebivins.com/?p=280</guid>
		<description><![CDATA[Note:  This is unfinished, and I&#8217;m still working on typing this up.
Last updated:  2008-09-29
We&#8217;re going to setup a web environment on Ubuntu Linux version 8.04, and I&#8217;ll stick with using the command-line for most things.  To access command line in Ubuntu, select
Applications -&#62; Accessories -&#62; Terminal 
Before you click on Terminal you can right-click on [...]]]></description>
			<content:encoded><![CDATA[<p><em>Note:  This is unfinished, and I&#8217;m still working on typing this up.</em></p>
<p><em>Last updated:  2008-09-29</em></p>
<p>We&#8217;re going to setup a web environment on Ubuntu Linux version 8.04, and I&#8217;ll stick with using the command-line for most things.  To access command line in Ubuntu, select</p>
<p style="text-align: center;"><strong>Applications -&gt; Accessories -&gt; Terminal </strong></p>
<p>Before you click on Terminal you can right-click on Terminal, and choose Add This to Launcher Panel.  Doing this makes the terminal (console) accessible from the top menu-bar.</p>
<p><strong>1.  Bringing the System Up to Date</strong></p>
<p>We&#8217;ll make sure that our system has the latest security patches applied to it, and we&#8217;ll need to get a list of what&#8217;s available.  Typing sudo before commands gives us administrative access to do things that normal users cannot do.  Type:</p>
<p><code>sudo apt-get update</code></p>
<p>The command line will ask you for your password.  Yes, I know that it&#8217;s annoying that your computer is asking you for your password again even though you&#8217;ve already signed in to your machine.  This prevents someone from running administrative tasks when you&#8217;ve momentarily stepped away from your desk.  You&#8217;ll also notice that if you wait long enough after typing a sudo command, the system will request your password when typing another sudo command.</p>
<p>Type in your password and press enter.</p>
<p>Instead of applying the latest security updates, we&#8217;ll upgrade all applications to the latest versions.  I&#8217;m sure that quite a bit has changed in the five months since Ubuntu 8.04 was released.  Versions of Ubuntu correspond to a year and a month, and 8.04 means that it was released on April of 2008.  Type:</p>
<p><code>sudo apt-get upgrade</code></p>
<p>You&#8217;ll see the following output:</p>
<p><code>114 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.<br />
Need to get 127MB/129MB of archives.<br />
After this operation, 2449kB of additional disk space will be used.<br />
Do you want to continue [Y/n]?</code></p>
<p>Type in Y and press enter.</p>
<p>Find something productive to do for the next 15 minutes as it pulls down the latest programs and installs them.</p>
<p>After everything is finished, you can reboot your system by typing:</p>
<p><code>sudo shutdown -r now</code></p>
<p>When running the upgrade step, it mentioned that 5 packages where held back.  To install these, type:</p>
<p><code>sudo apt-get dist-upgrade</code></p>
<p>To which you&#8217;ll see the following output:</p>
<p><code>The following NEW packages will be installed:<br />
libdns35 openssl-blacklist<br />
The following packages will be upgraded:<br />
bind9-host dnsutils libbind9-30 libisccfg30 ssl-cert<br />
5 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.<br />
Need to get 7059kB of archives.<br />
After this operation, 13.8MB of additional disk space will be used.<br />
Do you want to continue [Y/n]?</code></p>
<p>Type Y and press enter.</p>
<p><strong>2.  Installing the Web Environment</strong></p>
<p>Running the following commands with install Apache, MySQL, and PHP, a web server, a database, and programming language, respectively.  A majority of this is taken from this <a href="http://ubuntuguide.org/wiki/Ubuntu:Hardy#Install_a_LAMP_server_on_a_Desktop">Ubuntu guide</a>.  The only difference is that I&#8217;m not installing phpMyAdmin, opting for using the command-line instead.  To install these type:</p>
<p><code>sudo apt-get install apache2 php5 mysql-server-5.0</code></p>
<p>The system will prompt you with:</p>
<p><code>NEW packages will be installed:<br />
apache2 apache2-mpm-prefork apache2-utils apache2.2-common<br />
libapache2-mod-php5 libapr1 libaprutil1 libdbd-mysql-perl libdbi-perl<br />
libmysqlclient15off libnet-daemon-perl libplrpc-perl libpq5 mysql-client-5.0<br />
mysql-common mysql-server-5.0 php5 php5-common<br />
0 upgraded, 18 newly installed, 0 to remove and 119 not upgraded.<br />
Need to get 42.6MB of archives.<br />
After this operation, 124MB of additional disk space will be used.<br />
Do you want to continue [Y/n]?<br />
</code></p>
<p>Type Y and press enter.</p>
<p>During the course of the installation, you&#8217;ll be prompted for an administrative (root) MySQL database password.</p>
<p><a href="http://joebivins.com/wp-content/uploads/2008/09/screen1.png"><img class="alignnone size-full wp-image-288" title="mysql5-root-password-screen" src="http://joebivins.com/wp-content/uploads/2008/09/screen1.png" alt="" width="500" height="331" /></a></p>
<p>Think of a password, type it in a press enter.  The system will ask you to retype your database administrative password for confirmation.</p>
<p><strong>3.  Configuring the Web Server</strong></p>
<p>At this point everything we need is installed and running.  So, let&#8217;s test the web server.  Open a web browser and browse to http://localhost.  This brings up the default web page residing on the web server.</p>
<p><a href="http://joebivins.com/wp-content/uploads/2008/09/works.png"><img class="aligncenter size-full wp-image-304" title="works" src="http://joebivins.com/wp-content/uploads/2008/09/works.png" alt="" width="500" height="300" /></a></p>
<p>It&#8217;s reassuring to know that the web server is running, but where is the web page that says &#8220;It works!&#8221; on your computer?</p>
<p><strong>3.1 Finding Apache&#8217;s Configuration Files and Web Directory</strong></p>
<p>First we&#8217;ll need to locate Apache&#8217;s configuration file, httpd.conf.  On Unix systems configuration files are located in the /etc directory.  To locate this file from the command line use the find command.</p>
<p><code>find /etc -name httpd*</code></p>
<p>This generates the following output:</p>
<p><code>find: /etc/ssl/private: Permission denied<br />
find: /etc/cups/ssl: Permission denied<br />
/etc/apache2/httpd.conf</code></p>
<p>Apache&#8217;s configuration file resides at /etc/apache2/httpd.conf.  However, running the find command produced &#8220;Permission denied&#8221; errors, meaning that the find command could not access a directory.  This can be quite annoying when you&#8217;re searching for more nebulous file names and dozens of &#8220;Permission denied&#8221; errors appear.  Let&#8217;s remove the Permission denied errors from the output by redirecting any errors to the Trash Can, or using technical terms, /dev/null.</p>
<p><code>find /etc -name httpd* 2&gt; /dev/null</code></p>
<p>Produces:</p>
<p><code>/etc/apache2/httpd.conf</code></p>
<p>That&#8217;s better.</p>
<p>Sadly, httpd.conf is an empty file.  Ubuntu has a different layout.  In Apache&#8217;s configuration files, there is a word DocumentRoot followed by the directory where Apache&#8217;s web pages live.</p>
<p>Using the find command, search the Apache configuration directory for files containing the word DocumentRoot.</p>
<p><code>find /etc/apache2 -exec grep -i documentroot {} \; -print</code></p>
<p>Produces:</p>
<p><code>DocumentRoot /var/www/<br />
/etc/apache2/sites-enabled/000-default<br />
DocumentRoot /var/www/<br />
/etc/apache2/sites-available/default</code></p>
<p>There two configuration file, 000-default and default (technically these refer to the same file), both have the DocumentRoot set to /var/www.  Let&#8217;s see what&#8217;s in that directory.  To list files, use the ls command.</p>
<p><code>ls /var/www</code></p>
<p>Produces:</p>
<p><code>index.html</code></p>
<p>The cat command displays the contents of a file.</p>
<p><code>cat index.html</code></p>
<p>Produces:</p>
<p><code>&lt;html&gt;&lt;body&gt;&lt;h1&gt;It works!&lt;/h1&gt;&lt;/body&gt;&lt;/html&gt;</code></p>
<p>This is the &#8220;It works!&#8221; page that we saw when browsing to http://localhost.</p>
<p>On Ubuntu Apache&#8217;s default configuration resides in /etc/apache2/sites-available/default and the default directory holding web pages is in /var/www.</p>
<p><strong>3.1 Creating Web Directories</strong></p>
<p>Since one of my future tutorials will use an application framework, I’m going to create two web servers, one with the application framework and one without one.  The following instructions will create two web servers pointed at two different directories.  I’m not concerned about loading PHP or a framework at this point.</p>
<p>These web servers will be for local development and are not intended to be accessible from the outside world.  Webform.localhost will be the web server without the framework and zf-webform.localhost will be the web server with the framework.</p>
<p>Using the command line, create directories to house web files.</p>
<p><code>mkdir -p ~/www/webform<br />
mkdir -p ~/www/zf-webform</code></p>
<p>The mkdir command creates a directory (folder).  The -p option creates directories to put other directories in if the don’t exist yet.  Here, we are placing the webform directory inside the www directory, and at this point www doesn’t exist yet, and the -p option allows use to create one.  The tilda (~) prefixing the path indicates that this is relative to your home directory.  In my case home my directory is /home/jbivins.  This will be different that your home directory.</p>
<p>To find out your what your home directory is.  Type:</p>
<p><code>cd ~<br />
pwd</code></p>
<p>The cd command changes the working directory to your home directory, and the pwd command will show the full path of the current directory.  You’ll need to know the location of your home directory as we’ll later tell the web server the location of our files.</p>
<p><strong>3.2 Creating Web Server Names</strong></p>
<p>Using a technique known as name-based virtual domains, we are going to create names for our web servers.  The web server will see an incoming request for either webform.localhost or zf-webform.localhost and will determine which web directory to use based on the name requested.</p>
<p>Before we do this though, we need to instruct that webform.localhost and zf-webform.localhost refers to your web development machine.  From the outside world, webform.localhost and zf-webform.localhost will lead you elsewhere.  You can assign them separate ip-addresses to each name but with name-based virtual domains that is not necessary.</p>
<p>A list of names and ip-addresses known locally to the machine is kept in /etc/hosts.</p>
<p>sudo pico /etc/hosts</p>
<p><a href="http://joebivins.com/wp-content/uploads/2008/09/pico-hosts-file.png"><img src="http://joebivins.com/wp-content/uploads/2008/09/pico-hosts-file.png" alt="" title="pico-hosts-file" width="500" height="331" class="aligncenter size-full wp-image-324" /></a></p>
<p>Pico (now called nano) is a user-friendly text editor, featuring a menu at the bottom of the screen.  The caret (^) symbol means that you need to press the control key in addition to the letter follow it.  Seeing ^O means to press Control and O (O not zero) at the same time to perform that command.</p>
<p>Control and O saves the file.<br />
Control and X exits the editor. </p>
<p>In the pico editor, add the following lines:</p>
<p>127.0.0.1 webform.localhost webform<br />
127.0.0.1 zf-webform.localhost zf-webform</p>
<p>Press Control and O.  Press enter.<br />
Press Control and X.</p>
<p><strong>3.3 Enabling Name-Based Virtual Domains</strong></p>
<p>Returning to the command line, we’ll instruct the Apache web server to use name-based virtual domains.  This requires editing the main apache configuration file located at /etc/apache2/apache2.conf.</p>
<p><code>sudo pico /etc/apache2/apache2.conf</code></p>
<p>Once in the editor add the following line to the bottom of the configuration file:</p>
<p><code>NameVirtualHost *:80</code></p>
<p>In pico, move to the bottom of the file by pressing the Alt key and slash (/).</p>
<p>Save the file and exit the editor.</p>
<p><strong>3.4 Web Site Configuration Files</strong></p>
<p>Ubuntu Linux holds its configuration files in /etc/apache2/site-available.  There’s a set of configuration files in /etc/apache2/sites-enabled designating which web sites are turned on.</p>
<p>Create a configuration file for the first web server.</p>
<p><code>cd /etc/apache2/sites-available<br />
sudo pico webform.conf</code></p>
<p>Enter the text below into the editor.  Change the text to the right of the DocumentRoot and Directory to match the web directory that you created for webform.localhost.</p>
<pre name="code" class="xml">

&lt;VirtualHost *:80&gt;
        ServerName webform.localhost
        ServerAlias webform
        ServerAdmin me@localhost
        DocumentRoot /home/jbivins/www/webform
        &lt;Directory /home/jbivins/www/webform&gt;
                Options -Indexes
                AllowOverride All
                Order Allow,Deny
                Allow From All
        &lt;/Directory&gt;
&lt;/VirtualHost&gt;
</pre>
<p>In this configuration file, this web server is given two names, through the ServerName line the primary name of the web server is webform.localhost.  The ServerAlias line gives the web server a nickname, webform.  After we are done, entering either webform.localhost or webform into the address bar of an Internet browser will display the pages in the DocumentRoot directory.</p>
<p>To find out the web directory that you created in step 3.1, open up a new terminal session and type:</p>
<p><code>cd ~/www/webform<br />
pwd</code></p>
<p>The output will be the web directory for the above configuration file.</p>
<p>Next, we’ll enable the web server.  In reality, Apache only looks at the configuration files located in /etc/apache2/sites-enabled.  Instead of copying the configuration file to the sites-enabled directory, we’ll create a file that links to the actual configuration file.  This avoids maintain two separate configuration files.</p>
<p>Use the ln command to link a file to another.</p>
<p><code>sudo ln -s /etc/apache2/sites-available/webform.conf /etc/apache2/sites-enabled/webform.conf</code></p>
<p>The -s option in the ln command creates a symbolic link to the file.  Removing the link will not remove the file.</p>
<p><em>Todo:  Finish this part</em></p>
<p><strong>4.  Configuring the Database</strong></p>
<p><em>Todo:  Finish this part</em></p>
]]></content:encoded>
			<wfw:commentRss>http://joebivins.com/2008/09/21/setting-up-a-web-environment/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Web Forms</title>
		<link>http://joebivins.com/2008/09/14/web-forms/</link>
		<comments>http://joebivins.com/2008/09/14/web-forms/#comments</comments>
		<pubDate>Sun, 14 Sep 2008 19:32:20 +0000</pubDate>
		<dc:creator>joe.bivins</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://joebivins.com/?p=251</guid>
		<description><![CDATA[One of the repetitive web development tasks is collecting form field input from a web page and doing something meaningful with that data.  People sign-on to check their e-mail and register for new services all of the time.  To do this, you have to key your information into a set of fields on a web [...]]]></description>
			<content:encoded><![CDATA[<p>One of the repetitive web development tasks is collecting form field input from a web page and doing something meaningful with that data.  People sign-on to check their e-mail and register for new services all of the time.  To do this, you have to key your information into a set of fields on a web page, and I&#8217;ll delve into the intricatcies of what happens behind-scenes when you do this.</p>
<p>As with any programming problem, there are a variety of ways to accomplish the task, each having its own set of advantages and disadvantages.  For now, I&#8217;ll use the term web form, although it isn&#8217;t a de-facto term used among programmers, to designate a web page where some types in data and sends clicks a button to send it off somewhere.  I&#8217;ll try to use terminology that the common person can understand.</p>
<p>Practical applications of using web forms include:</p>
<ul>
<li>Registering people on a web site.</li>
<li>Logging a user onto a web site.</li>
<li>Allowing users to search for and view information.</li>
</ul>
<p>There&#8217;s a plethora of web programming languages available:  PHP, Java, Ruby, .NET, etc.  Some languages are lax in what you can do where as others force you to do things a certain way.  Regardless of the language, there&#8217;s a common road map, or flow diagram, for processing a web form.</p>
<p style="text-align: center;"><a href="http://joebivins.com/wp-content/uploads/2008/09/web-form-flow.png"><img class="size-full wp-image-264 aligncenter" title="web-form-flow" src="http://joebivins.com/wp-content/uploads/2008/09/web-form-flow.png" alt="" width="500" height="647" /></a></p>
<p>I&#8217;ll choose PHP as my choice of programming language because that&#8217;s what I actively use to build web pages.  In the next set of tutorials related to this topic, I&#8217;ll:</p>
<ol>
<li>Set up a web development environment in Ubuntu Linux.</li>
<li>Show how to process web forms using PHP 5.</li>
<li>Show how to process web forms using PHP 5 and AJAX.</li>
<li>Show how to process web forms using PHP 5 and an application framework, the Zend Framework.</li>
</ol>
<p>I&#8217;m aware that I used two buzz-words, AJAX and application framework.  I&#8217;ll explain them more in-depth in the subsequent tutorials.</p>
]]></content:encoded>
			<wfw:commentRss>http://joebivins.com/2008/09/14/web-forms/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
