MG:U series, interlude

I am planning out the next few steps in our ModelGlue:Unity series and would like to tally a vote. Currently our Contact-O-Matic is barebones. We went over how to use portions of ColdSpring to manage our service and to pass in configuration parameters. We also went over adding ModelGlue results to change the programmatic flow of the application. Following this pattern, you should have a good base on ModelGlue:Unity.

However, apart from the tabs, it has a plain-jane look and feel. Heck, it doesn't even save the contacts for very long ;). Before all is said and done, we will add in database persistance, security, the Transfer ORM and some Ajax.

We are going to need to put database persistance really soon as it is keeping us from our larger goals. After that, there are three different paths we can go.

In the spirit of Choose Your Own Adventure ( man, I loved those books ) which would you rather we tackle next? The choices once again:

  1. Easy MG:U Security
  2. MG:U scaffolding with Transfer ORM
  3. Ajax Enhancements

Also, if you are following along with the series, please leave a comment or send me an email with the database you use on your development server. I am going to make an effort to be as cross-DB as I can....

There are no comments for this entry.

Add Comment Subscribe to Comments

1/1/08 9:24 PM # Posted By Aron Thomas

This is a nice series. Security is such an important. I am also agree with the comments above especially AJAX, that does not cause a larger Attack Surface. See more here

about security and hope it helps.

1/23/08 3:28 AM # Posted By Jango

AJAX also reduces security and privacy for the person using the web page in the following subtle way.

In the old synchronous model, one typed information into a web form, checked it for accuracy, relevance, etc., edited it if desired, and then pressed a submit button which sent it on its way.


1/23/08 10:25 PM # Posted By Kharl

Jango, Here are some prerequisite

Before you go INTO the AJAX stuff, I want to share with you the random images script and how that works. It's a really simple PHP script that looks for images inside a directory located on my web server and then selects a random one and outputs an image tag for the HTML. This is called random_icons.php and its placed in my DocumentRoot. Here's a look at this script:
Code Example: (!)

$files = array();
if ($handle = opendir($_SERVER['DOCUMENT_ROOT'].'/dc_icons/')) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
$files[] = $file;
echo '<img style="width:200px; height:150px;" src="/dc_icons/'.$files[rand(0, count($files) - 1)].'" alt="Our Facilities" />';

Notice that the directory where the random images are located is: dc_icons under my DocumentRoot. If you were to access this file directly FROM your browser, you would get a random picture every time. Nothing too dramatic about that. Here's the actual output script on our server:,

1/23/08 10:31 PM # Posted By Jango

Thanks Kharl, that was a nice explanation. Now, I understand how the random icons script works.

But how I spiced up using AJAX?

1/24/08 2:56 AM # Posted By Angeline

Thanks guys. Thanks for the prerequisite sample by Jango. All of you are genius. This helps me a lot :)

Add Comment Subscribe to Comments