October 31, 2006

Debug flash communication

You will find other articles relevant to this document in these sections:
Cameron Manderson @ 10:19 am

For a few recent projects we have been implementing a RIA (Rich Internet Application) interface to browse the website. Namely Adobe Flash. When running the flash movies in the browser player it is often difficult to diagnose communication problems that occur, such as HTTP errors (like 404, 501) as well as XML, SSL and Flash Remoting.

After having a bit of a play around I found that Macromedia/Adobe installs a few debug flash movies to aid your diagnosis when you install the Flash Remoting extensions. These are located in your application data, usually something like:

“C:\Documents and Settings\cman\Local Settings\Application Data\Macromedia\Flash 8\en\Configuration\WindowSWF\NetConnection Debugger.swf”

Note: You may need to change your folder view settings in windows so you can see hidden folders.

While this is a great start and can often be just what you need, another good tool that I found for helping you diagnose communication between the server and your browser generically for all sorts of comms (eg, showing your HTTP generated by your HTML) is ServiceCapture.

I had used this to view the returned Flash Remoting packages, which ServiceCapture kindly deflates and presents returned results for you, as well as timing the requests, size of request packets etc. The program comes with a trial period, by required you to pay US$34.95. But the amount of time it saves you and how much you come to rely on its diagnosis it is well worth the investment.
As most testing goes, it is about your toolkit. Giving you a good set of tools that you can configure to give you answers about why things are going wrong saves you a lot of additional trace statements.

ServiceCapture link

October 30, 2006

T2Tea - Online tea, gifts and homewares shopping/ecommerce with Flash

You will find other articles relevant to this document in these sections:
Cameron Manderson @ 11:31 am

If any of you have been wondering where I have been or been upto leading up to October, it has been working on the new T2 Tea website.

T2 offers Australia’s largest range of beautiful, fragrant teas from around the world. The website offers ways to further create the experience offered in their award-winning stores; browse for teawares and learn the delicate art of brewing tea developed over many centruries.

The T2Tea website (powered by Radiant Logic PTY LTD we have won a IMA award) has been a completely revamped version of the 2005 XMas site we did last year, and has been redone completely in Flash. It allows visitors to interact with T2 through the web in completely new ways, through interactive tea selectors, learning how to brew and interactive shop creating a whole new experience for the visitor.

Working with the talented new media team at Carbon+ (now Rich Creative), Radiant Logic PTY LTD had the task of designing and developing the Ecommerce and Content/Product Management for the project, as well as creating a fast system for the Flash Designers and Developers to access and search the information, and, process orders, with zero impact on their design. Using Flash Remoting and my own developed Ecommerce and CMS products this developed the foundation to power the rich interface (RIA) architecture with zero impact on the design/presentation of the interface. Staff can quickly update all content, including products, news and pages, staff area, employment etc. The ecommerce system accepts online credit card transaction, calculated australia post shipping and optinal gift wrapping services as well. There was never a break across to HTML like many other Flash ecommerce sites, this site kept the user in the site the whole time while still providing a Safe Secure system for visitors to process their purchase orders online. The system saves time for various wholesaler and resellers by allowing ordering to occur online instead of a paper based system.
Please check out the site and have a browse of all the interactive features, I hope you enjoy:

http://www.t2tea.com.au/

NOTE: As well as this project I have been working on several other flash driven sites, all content managed, as well as another flash ecommerce project to be launched shortly. I will keep you posted.

I’m back!

You will find other articles relevant to this document in these sections:
Cameron Manderson @ 10:54 am

I have been away for a while overseas and have just stepped back into the office. We were away travelling in Hong Kong and Italy, going to Venice, Milan, Como, Bellagio, Cinque Terra, Luca, Siena, Florence and Rome, flat out! We will be sorting through some photos and I will place up the link to Flickr when I get a chance. Trip was fantastic, has racked up quite a bit on the CC though! as expected!

October 25, 2006

Firefox 2 Out Now!

You will find other articles relevant to this document in these sections:
Richard Lee @ 1:18 pm


faster, more secure, and fully customizable to your online life - moz

I managed to grab a copy of Firefox 2 earlier in the week so I’ve had a good chance to play around with it and I’m very impressed. From the outset it doesn’t look dramatically different. There’s a slightly different skin, but everything is still in its place and works very similarly but with a few subtle differences.

In version 1 you couldn’t close tabs without first activating them then clicking the close button in the top right of the tab panel, in version 2 each tab has been given it’s own close button. Also another annoyance in version 1 was how tabs just seemed to disappear when they tab panel exceeded the browser window. Tabs became inaccessible until you closed other tabs, in version 2 a scrollable panel has been introduced so that you can scroll backwards and forwards through your tabs.

Another nifty addition is the ability to resume previously tabbed browser sessions, so you can pick up where you left off. And then there’s the inline Spell Checker! If your a typo king like me you’ll find this little feature simply brilliant - misspell a word in a form and the Spell Checker will underline it in red, where upon you can simply right click and make the correction.

Anyway there are a lot more great additions to Firefox 2. Let us know what you think ;)

Creating readable URLs with mod rewrite

You will find other articles relevant to this document in these sections:
Richard Lee @ 12:56 am

Ugly URLs…
Querystring style URLs like below are synonymous with dynamic systems

http://www.mysite.com.au/catalog.php?category=cartridges&prod_id=33

While URLs like this are completely functional, there are a few issues with URLs like this you should consider before going live:

  1. The underlying technology is exposed such that script kiddies can inject their own data - such as an sql injection.
  2. The URL contains ampersands which, when unescaped will affect the XHTML compliance of linking websites
  3. Search engines will avoid indexing dynamic pages like this

So without refactoring the application how can you make more freindly URLs? A simple solution for Apache based users is to utilize the mod rewrite module.

mod rewrite to the rescue!

Note: mod_rewrite is not loaded into Apache by default, to do so open your httpd.conf file and uncomment the module load code

Apache’s mod rewrite module can rewrite requested URLs on the fly, meaning you can substitute ugly querystrings with meaningful URLs, which address security issues, compliance and SEO. So how does mod rewrite work?

Basic rewriting

Typically mod rewrite directives are added to a htaccess file in your web root. Here’s a simple example to start with:

RewriteEngine on
RewriteRule ^old_page.html$ new_page.html

This rewrite transparently redirects a request for old_page.html to new_page.html. The first line enables the engine (only required once per htaccess file):

RewriteEngine on

This next line basically tells the server if there is a request matching oldpage.html, then substitute it with new_page.html. The caret ^ and dollar $ sign signify the start and end of the string used for the match.

RewriteRule ^old_page.html$ new_page.html

If you want to actually do a more traditional redirect and show the location of the page in the status bar just add [R] to the end of the RewriteRule.

Easy enough? That was a pretty simple rewrite. The real flexibility of mod rewrite requires some knowledge of Regular Expressions, which can get quite complex. However, the functionality and flexibility Regular Expressions offer in PHP make them well worth learning. So lets take a look at some common rewrites and the expressions used to make them happen.

Unleashing mod rewrite with Regular Expressions

With the help of Regular Expressions we can create RewriteRules which match a set of URLs and redirect them to their actual pages. Consider the products pages in our fictional Shopping Cart app which only vary in category name and product id. We can identify requests for products page by specifically matching the PHP filename, something representing a category name, forward slash, then something representing a product id. And here’s how our rule looks:

RewriteRule ^catalog/([a-zA-Z0-9-])/([0-9]+)/$ /catalog.php?category=$1&prod_id=$2

The parts in square brackets are known as ‘ranges’. In this case where allowing anything in an alphanumeric range (case insensitive) for our category name, then anything in the numeric range for our product id. We’ve also encased these regular expressions in parenthesis so we can ‘back reference’ our matches to pass the values onto our PHP page. Back referencing is done via indexing each set of parenthesises, $1 for our first parenthesises, being our category name, and $2 for our second parenthesises, being our product id.

Well this is the end of my tutorial on how to use mod rewrite to create freindly URLs. If you have any questions please feel free to post a comment. Cheers!

October 10, 2006

Whois - a spammers resource?

You will find other articles relevant to this document in these sections:
Richard Lee @ 11:56 am

Recently I received a “notice of domain expiration” from the Domain Registry of America in the post. I’ve never dealt with these guys in the past so it was quite obvious that my information had been lifted from the whois database as entered by my domain registrar. To my knowledge any use of whois data for commerical benefit is prohibited(?) but honestly, who enforces this? I have made numerous abuse reports to hosts in the past to no avail, which really begs the question whats the point of whois if not to provide a wealth of information to spammers and would be spammers?

Perhaps a better idea for APNIC and co. is to list domain registrar contact information only - and keep the domain holder info private. I can’t see why info such as the domain holder address and what he/she eats for breakfast is made public record.

October 5, 2006

Firefox 2 RC1 “Bon Echo”

You will find other articles relevant to this document in these sections:
Richard Lee @ 10:28 am

Earlier this year we did an overview of the Firefox 2 beta release, after much anticipation the guys over at Mozilla have release Candidate 1. Code named “Bon Echo” this is a preview release for web developers and curious users wishing to take a sneek peek. Here’s the official features list;

  • A new theme that updates Firefox’s familiar interface
  • Built in Phishing Protection
  • Enhanced search engine management and search suggestions for Google, Yahoo! and Answers.com
  • Improvements to tabbed browsing, including the ability to re-open recently closed tabs
  • Firefox will resume from where you left off after a system crash or browser restart
  • Better support for previewing and subscribing to Web feeds
  • Inline spell checking in Web forms
  • The ability to create bookmarks with “Live Titles” for Web sites that offer microsummaries
  • New Add-ons manager that simplifies management of extensions and themes.
  • Support for JavaScript 1.7
  • Extended search plugin format
  • Updates to the extension system to provide enhanced security and to allow for easier localization of extensions
  • Support for client-side session and persistent storage
  • Support for SVG text using svg:textPath
  • New Windows installer based on Nullsoft Scriptable Install System

    Source: http://developer.mozilla.org/devnews/

It also looks like Firefox 3 is in the pipeline…
For more info on the brains behind release 2 and Firefox in general checkout the Bon Echo Planning Centre and Firefox Brainstorming page