Delphi for PHP Article 1: A Video Walk Through

Rumors have been flying around for the last month about Borland producing a PHP product. “PHP? Are they nuts?” some said, “Concentrate on what you know! Are you trying to create another Kylix just to have it fade away to nothing?” Needless to say, I was a bit more optimistic than that… I mean come on! RAD PHP development? How cool would that be? PHP has the EXACT same feel as Pacal did back in the late 80s. It’s a baby language just starting to grow up. Even the people in it have the same core “I’m gonna help you because I know later you will help me” attitude that Pascal and Delphi always had.

Plus, since the restructuring of Borland has sifted the chaff from the wheat, CodeGear seems have its act together and the people of CodeGear are really the cream of the crop. (Yes, I know. I just said that they are Cream of Wheat, let it go… just let it go.)

Well, dreams came true when I was invited to be a CodeGear field tester. And last Thursday morning, with the verbiage hot off the presses from the Borland legal department, I was granted a limited exemption from my NDA (Non-disclosure agreement) to pitch a possible Google Summer of Code 2007 joint D4p/WordPress project to Automattic (I’ll let you know later how that turns out…). That NDA exemption also gave me permission to post articles and write reviews of the product. So here we are today!

So, now I can show you tell you all about the cool stuff I’ve been doing and show you movies I’ve made of the product in action.

In my usual fashion, I’ve written a gargantuan article. Instead of posting huge thing, I’m splitting the sections off into separate articles. Today, I just want to give you walk through of the product and show you some of the stuff that makes it unique.

This video uses a pre-release version of Delphi for PHP. Components, look and feel, and features may change before release. THIS VIDEO HAS SOUND.

If you have any problems with the video playback on any browser please let me know and I will try to get it to work.

Sorry for the down time!

The website functioned PERFECTLY as long as you were logged in! HONEST! 

Anyway, Lloyd, Cindy and Joe EVENTUALLY convinced me that they really weren’t insane.  Even my wife told me she got an error on the site, I just thought it was her IE6 gagging on a media file as it is prone to do.

And people think programmers are making it up when they say “Well, it works fine when I do that…”

But hey – what’s 10 hours of down time amoungst friends… Sheesh…

PS. For the record  DO NOT use Anarchy Media Player Plugin 2.0 Beta with version 2.1.2 of WordPress…  Stick with 1.6.5 even though you don’t get buttons on the editor any more.   Or you will get the behaviour I did.  I’ll diagnose it later.

The Code Cave’s 1 year Blogaversary: Confessions of a Code Monkey


It was one year ago, Feb 28, 2006 to completely precise, that first came on line.  A week later I had a fairly functional website, running WordPress with a theme I was satisfied with and a bunch of great ideas. 

This site was mostly meant for my own convenience as a place where I could put Delphi and PHP code fragments  that I knew I could find later.  I have used it for that again and again and again.  It is a MUCH better resource than Microsoft Outlook’s sent folder.  Plus, now that someone named Meagan works at the office, every time I simply type ME in the To: address of an email, I send stuff to her instead of my home account.  (Sorry, Meagan, for all of those meaningless code fragments in your email account.)

Anyway,  my wife first suggested the name The Code Cave.  Since I liked caving and coding, it made sense to her.  Since it had multiple meanings, I, of course loved, it.  (A code cave, you know, is empty space in an executiple where all sorts of neat treasures can be hidden.)  So it worked.  

A year later, the site has a google rank of 357,000, which is not to shabby in my book.  Especially since I had a couple dry spells of 1 post per month.  I’ve just gotten my first Adsense check deposited and that pays for next year of hosting in full.  So, the site is self sufficient.   I’ve also been told that I’ve helped loads of people (Sweet).  And my life is enriched by coming to know loads of new people I’ve met through the site.

Not a bad year…   Her sites have done well too.  She hosts of course (where I’d been doing php and WordPress for a whole year before TheCodeCave. came around), and Loom Out Loud, and now  a new knitting magazine site: Loom Knitter’s Circle.

 I plan to do a number of “Posts that never made it” posts, the first one of which was the Delphi source code for turning any 1and1 account into a Dyn DNS server posted yesterday.  I had a whole series of web automation posts planned, but I never put them up.  I hope to get a number of them up. I’ve found that when I stop using this site a repository, and start using it as a blog, I get less code up here and less posts up here. So, the posts will get up here when they get up here.

So, for an old Borland Turbo Prolog/Turbo C/Turbo Pascal coder, my venture into the web has been a good experience…  And I can’t wait to tell you all some of the good stuff that I’ve got going on right now…  I’m juggling a few nifty things right now and hopefully I’ll have some good news to share as a result. I’m smilin’ just thinkin’ about it.

code monkey – noun –

Download link

1. A person only capable of grinding out code, but unable to perform the higher-primate tasks of software architecture, analysis, and design. Mildly insulting. Often applied to the most junior people on a programming team. 2. Anyone who writes code for a living; a programmer. 3. A self-deprecating way of denying responsibility for a management decision, or of complaining about having to live with such decisions. As in “Don’t ask me why we need to write a compiler in COBOL, I’m just a code monkey.”      — The Jargon File

Delphi Demo: DynDNS through your WebHost’s CPanel (e.g.

aka Dynaminc DNS with

aka How to automate a Web Session with Delphi

 Here’s a program I’ve been beta testing for a few months.  I use it on a subdomain of to allow me to always reach my home.  I use Road Runner Cable from Time Warner and have a dynamic IP address.  That means that my IP can change at any point in time.  And it does!

I used to use the site Dyn.EE to provide a link to my house.   I always liked them because their client is written in Delphi.  However, now that I have and a gazillion subdomains hanging off of it (,, and the list goes on) I thought I would also make an url that connected to my house.

 This was tedious but quite duable to do once.  You just go into the control panel, create the domain, wait for it to become functional, and then modify the DNS settings and override the A record.  Simple right? Well mostly, it is just point and click at what seems logical.

 However, that’s a pain to do on a regular basis because well…

  1. The UI is slow.  The control panel takes for ever to get through.
  2. You have to first look up your own IP address first.  I usually would call my wife and have her send me an email and I’d grab it from the email header and then fix the DNS.  What a pain.
  3. Why suffer through minutes of clicking a few times a year when several hours of programming can get your around it?

So, I give you : The Code Cave’s Dynamic DNS Updater.

The Code Cave's DDNS Updater!

 The usage is simple. 

  1. Create a subdomain on your site and twiddle your thumbs til it becomes active sometime in the next hour or two.
  2. Enter that domain in the first field.  NOTE: If you put your main URL, your main URL will no longer point at your website.  Be careful!  You want this to be something like:
  3. Enter the main password for your account.  This is sent over HTTPS to and not to me.  Have no fear. 😉  But it will appear in the debugging section if you check that “Show IE Data Sent” box.
  4. Click the Update Domain button and watch it work.

Your change should be available almost immediately, however, when debugging this program I sent the change a few (dozen) times and it eventually refused to allow any more updates to go through for another 24 hours.  It’s been fine ever since.  I’ve since changed the program so that does not try to update the DNS if the URL is already correctly set. 

I’ve additionally made the program so that it takes the three fields mentioned above as  parameters.  You can put this into Windows XP’s scheduler and every 15 minutes, it will check the current IP and update as needed.  Or just put it in your startup folder.  This of course means your password will be put into your scheduler, but you have the source code, you can add encryption if that is a concern on your PC.

So, an easy way to do it would be to create a short cut in the startup folder to the program with the parameters like this:


That will look something like this:

tcc_DDNSUpdater My1PaSsWoRd  12323213

 The quickest way to get your domain ID is to run the program manually once and just click the Update Domain button.  Then you can see the domain ID below.

 The program follows this procedure recreating the required browsing session (so it is only as fast as your connection to

  1. Go to and get the current IP address (This is a constant in the code and you can change it easily).
  2. Use a socket to retrieve the IP address for the URL you are looking up.
  3. If the two match, terminate the application.
  4. Navigate to and get a session ID needed to establish the secure login.
  5. Login using HTTPS, the domain to update as the user name, and the provided password.
  6. If a Domain ID has not been provided, navigate to the list of domains and retrieve the ID of the domain (The subdomain HAS to be amoung the first 50 domains, alphabetically, on your account.)
  7. Navigate to the DNS update page for that domain (a requirement of the 1and1 Control Panel software)
  8. Submit the DNS record change.

Simple as that!

The full delphi source is available in the Zip file.  The usual “If this crashes your site and costs you $30,000 dollars, why the heck did you run non-standard like this and risk a business site on it!  I’m not responsible for your site’s safety you are.  So consider the very real risk that things can go wrong with demo stuff downloaded off the Internet and err on the side of safety.” warning message applies.

You can download the file here: (link)

 I’ll post details of the code later.

I created this app using a Websession logger that might be of use to you.  I use it in my automation processes at work and also us it to create forum submission links that I could not have book marked on the web in any other fashion.

Enjoy! Joins Delph Feeds

There’s been a lot happening in Borland lately, specificaly in CodeGear territory.  These are exciting times.  I’ve got a whole lot of stuff that I want to tell you about.  However, first I’d like to introduce you to a site that you may not have heard of: Delphi Feeds.

Delphi feeds is a sort of one-stop-shop for Delphi related projects.  With some new and exciting projects coming out, your gonna be able to keep up to date there.  TheCodeCave ‘s Delphi category has now been added as of the feeds available on that site. 

 So, what that means is we might be getting a little more traffic here.  Also you’ll probably see some re-posts of my favorite Delphi projects I’ve shown here.  Perhaps I’ll update them to run in BDS 2006, Spacely or Highlander. 

What in the world is Spacely and Highlander?  Well, I can’t divulge too many details, but those familiar with the Codegear road maps know that Spacely is the version of Delphi due out at the end of March.  Spacely is the name used while it is in the testing phase. Spacely is an ONLY Delphi 2007 release.  Highlander on the other hand is a the BDS 2006 successor with the full trimmings.  You can find all these details and more by doing a little Googling and by visiting Delphi feeds.

I’ll have a detailed post about the Delphi for PHP release coming up shortly… This product has me the most excited.  It will revolutionize php development.  Please stay tuned…