I finally managed to get the PHP for my photo gallery working. Seems that PHP 4.2.0 and higher have a different default value ‘register_globals’ (it’s now set to ‘off’) meaning that you need to explicitly pass variables between functions. All i did was add $_REQUEST[‘var’]; in two places and it started working again.
It also means that I can host my friend Hugh’s photos and feel very jealous of his Nepal-Thailand trip.