Archive for August, 2007

Bash Arrays

Thursday, August 16th, 2007

So simple, it’s not funny.

 #!/bin/bash

array=”1 2 3 4 5 6 7 8 9 10″

Now you can add them into a for each loop:

for i in $array; do

echo $i;

done;

So simple, even a monkey could do it!

Cache by Intersystems, 4 and 5 on Debian?

Thursday, August 16th, 2007

The simple answer is Yes! Yes they do.

It requires a bit of love, but is not impossible. Run your cinstall as per normal and follow the exceptions if there are any.

Form Actions / PHP

Thursday, August 2nd, 2007

Always define your form action! Never set to “” - there is a good reason not to do it this way!

If you set to “” it defaults to the current Request URI. If that was a get request it might also contain variables eg. http://test/index.php?x=1&y=2
This is fine if you either (a) have the equivalent variables defined or (b) simply don’t use them. However if your script uses those variables it can become a debugging nightmare as these will become a part of your _REQUEST stack.

If using php and you want to use the current page as the post action - use action=”<?php print( $_SERVER['PHP_SELF'] ); ?>”.

You can also use $_POST to ensure GET variables arent included - however this may or may not work with your current environment.