if (($Filename != ".") AND ($Filename != "..")) ++$i;;
I do in that line, it works fine, and the numbers do count up, yet the html doesn't get written... 
Fixed declaring as a string now too, thanks 
EDIT: Could have sworn i saw a post by punky above this...
---------- Post added at 00:06 ---------- Previous post was yesterday at 23:54 ----------
Ah man i'm a dunce... Forgot to use the dollar sign $ before the i in the if statments to print the html...
Think i'm too tired...