INCLUDE_DATA

Category php

How To: Cloak your Affiliate Links for Free in Under 3 Seconds 3

Nov23

As Internet marketers, we all use affiliate links in some way or another. For some, they might be embedded into blog posts, while for others in landing pages or forum signatures. Regardless, affiliate links serve a necessary evil when making money online and we depend on them.

Introduction to Affiliate Link Cloaking
continue reading »

My first CodeIgniter site launched! www.PremierLeagueShirts.com 2

Oct31

I first mentioned CodeIgniter back in February 2007 as something that really excited me, but it took over a year and a half for me to actually use it!

Well, after a 2-day programming blitz, I launched my first CodeIgniter website yesterday. It’s hosted on the keyword domain www.PremierLeagueShirts.com and is an affiliate site targetting those looking for English Premier League jerseys. While still under heavy construction, the primary features are now available for use. The remaining changes will mostly be cosmetic and UI-related.

Here are some of the features that I programmed into www.PremierLeagueShirts.com:

And what’s left to come?

  • Improved GUI – Yes, the UI is plain. But my goal was to get the site out there and crawled by the major search engines. Now that that’s done, I’ll see what can be done about the look-and-feel of the site.
  • Improved Search – The site search currently only looks at the Product Name, and not the Brand, Category, or Description. This will be looked into.
  • Stats – Record what products are being looked at, what’s being searched for, and store that all in the database. Spit that out onto new pages on the site for further crawling by Google.
  • Additional Content – What is on the site right now is strictly affiliate products and their descriptions. Obviously Google may not like that so much, so will have to look at additional sources of related content.

So, what do you think so far? Since this is my first forray into the world of CodeIgniter, I’m please with what I’ve accomplished over the last 2 days.

FIX: Blank webpage problems when first setting up Code Igniter, PHP, MySQL, and Apache 1

Oct29

Today, I created my first website using the Code Igniter PHP framework and, oh boy, do I like it a lot more than Ruby on Rails. But I’ll dig into that further in a future post.

The purpose of this post is to shed some light on a problem that I wracked my brain over for a few hours last night.

The problem: After installing Apache, PHP, and MySQL and configuring the Code Igniter framework, you get a blank web page when testing your first controller, model, and view.

What I discovered were two issues that, when combined, create the perfect storm of an installation problem:

  1. First, MySQL is no longer enabled by default with PHP 5. Says the PHP website of MySQL in PHP 5:

    MySQL is no longer enabled by default, so the php_mysql.dll DLL must be enabled inside of php.ini. Also, PHP needs access to the MySQL client library. A file named libmysql.dll is included in the Windows PHP distribution and in order for PHP to talk to MySQL this file needs to be available to the Windows systems PATH.

    It’s been a LONG time since I’ve programmed in PHP let alone installed PHP, so this was news to me. Anyway, if check out the MySQL installation notes on the PHP website if you need help enabling MySQL.  

  2. Unfortunately, that was the easy part. Once I had an error message to work with, Google lead me to the PHP website, and I was in the clear. But, for the longest time, I wasn’t even getting an error page. Remember, all I was getting was a blank HTML page. So what was the cause? Code Igniter…
  3. Using some creatively placed die() calls, I found out that the application was dying when trying to connect to the database. (Previous to this, I had already double- and triple-checked my MySQL username and password in the Code Igniter configuration file, and had even tried out alternate accounts, like my MySQL root account.)What I found out was that the MySQL drivers in Code Igniter were suppressing errors when attempting database connections.

This is what the code looks like in the Code Igniter mysql_driver.php file:

function db_connect()
{
   if ($this->port != '')
   {
      $this->hostname .= ':'.$this->port;
   }
   return @mysql_connect($this->hostname, $this->username, $this->password, TRUE);
}
The “@” symbol before the mysql_connect() function call supresses any errors that may be returned. It is that symbol that wasted a good 2 hours of my life.Anyway, after I removed the “@” symbol from the code and re-tested my web application, PHP spit out the error message that I should have been presented with hours ago, and I was well on my way to fixing the problem.
 If you’re experiencing the same problem that I was, I hope this helps you correct it faster than I did! Best of luck.

Oh, and did I mention how much I prefer Code Igniter over Ruby on Rails? It’s messier, but with my C and Java background, it makes more sense than Ruby and Ruby on Rails does!

Been bitten by the programming bug again! 0

Aug30

It’s been a long, long time since I’ve done any web development in my free time– at least, any non-work related web development. Well, after batting around a few business ideas with buddies these past couple weeks, I’ve enough motivation to actually go ahead and see what happens with one (or two or three) of them.  But first, I need to prepare my development environment.

My aging laptop has been by my side throughout university and the first few years of post-university employment, and, well, has seen me use a myraid of tools for the many different development phases of my life. Lots of these tools have since aged into obsoleteness, so the first phase of my development environment preparation saw me ridding my harddrive of many of these tools and/or turning off services that are no longer used. Gone is Eclipse, as well as Apache 1.3, PHP 4, and that old version of MySQL. Cya later Ruby and Python. IIS? Disabled.

I’ve decided to use Code Igniter as my web application framework for these ideas I’m going to pursue. If you don’t already know, it’s a “powerful PHP framework with a very small footprint, built for PHP coders who need a simple and elegant toolkit to create full-featured web applications”, or so it’s website says at least. As such, after cleansing my laptop, I installed the newest versions of Apache, PHP, and MySQL. (Truth be told, I was surprised at the relative ease at which they were installed. No configuration mess at all, although I’ll probably have to do a httpd.conf refresher in a few days.)

Has anyone ever used one of those pre-configured WAMP installation packages, such as WAMP5 at WAMPServer.com? What are your thoughts? Worth using? At first, I was tempted to use one of these packages, rather than installing each of the tools separately, but decided that I wanted the freedom to upgrade whenver, rather than when the WAMP5 distributable was updated.

Anyway, my laptop is now almost all set to go! All that’s left is to set up some virtual directories, install Code Igniter, and then refamiliarize myself with PHP. Wish me luck!

3 things I’m excited about: Yahoo! Pipes, Code Igniter, and Facebook API 2

Feb9

Stumbled across 3 things this week that have me excited:

I’ve been looking for a quality, light-weight PHP framework for a while now, and Code Igniter seems to be exactly what I’m looking for. I’ve known about CakePHP, but never bothered with it… seemed to be bloated with a bunch of crap that I’m not interested in. A bonus is that tests indicate that Code Igniter is faster than CakePHP.

With regards to the other two (the Facebook API and Yahoo! Pipes), it’s just plain exciting to see companies releasing fun, geeky tools and making their APIs publically accessible.

Resurrecting this blog and broadening it’s focus 1

Oct28

I started work at TELUS over 10 months ago, and since that time, I’ve barely written a stitch of Ruby, let alone learn anything more about Ruby on Rails. My TextDrive account is no longer active and the experimental websites I launched while actively learning Ruby on Rails have been shut down. Essentially, I’ve lost all connection and interest in RoR and the RoR community.

For that reason, I’m renaming my blog from “Rory on Rails” to simply, “Rory Hansen”, as I don’t foresee myself writing about Rails anytime in the near future. Who knows– maybe somewhere down the line, I’ll regain interest in RoR, but right now, my mind and my time are focused elsewhere.

At work, I program almost exclusively in ASP.NET and C#. For the type of development I do, ASP.NET is fine. I appreciate the power of the framework and, given my experience with it now, I can get new webapps up and running quickly and easily. Do I like ASP.NET? Actually, yes I do.

Outside of work, I’m constantly trying to better myself through learning new skills and improving existing abilities. As my buddy Jeff would say, I’m just trying to ”raise my NPV.” Whether it be by reading great business books like Blue Ocean Strategy or Good To Great, or by practicing my networking skills at various conferences around town, I’m consciously trying to improve myself, thus raising my “market value,” so that when I’m ready to find a great new job somewhere, I’ve positioned myself as best as I can to actually get that job.

So, with all of that said, future posts on my blog will be about many of my current interests, such as learning how to play the acoustic guitar, improving my communication and networking skills, making change happen in business, and futher developing my leadership abilities.

Stay tuned!

Rory

Sparklines: Intense, Simple, Word-Sized Graphics 0

Jul4

I learned about Sparklines today through Brad Feld’s blog. Sparklines, as devised by Edward Tufte (of The Cognitive Style of PowerPoint fame), are small, word-sized symbols and graphs that appear inline within your sentence. The goal is to increase the meaning of what your saying, in ways that words along just can’t. For example, you might see a tiny, 30-day graph for a certain stock beside the stock symbol itself in a newspaper, just to give you an idea of the stock’s trends over the last little while.

If you know PHP, you can add Sparklines to your website using the PHP Sparklines Graphing Library.