Thin films of surfactant-templated mesoporous materials(1,2) could find applications in membrane-based separations, selective catalysis and sensors. Above the critical micelle concentration of a bulk silica-surfactant solution, films of mesophases with hexagonally packed one-dimensional channels can be formed at solid-liquid and liquid-vapour interfaces(3-5). But this process is slow and the supported films(3,5) are granular and with the pore channels oriented parallel to the substrate surface, so that transport across the films is not facilitated by the pores. Ogawa(6,7) has reported a rapid spin-coating procedure for making transparent mesoporous films, but their formation mechanism, microstructure and pore accessibility have not been elucidated. Here we report a sol-gel-based dip-coating method for the rapid synthesis of continuous mesoporous thin films on a solid substrate. The influence of the substrate generates film mesostructures that have no bulk counterparts, such as composites with incipient liquid-crystalline order of the surfactant-silica phase. We are also able to form mesoporous films of the cubic phase, in which the pores are connected in a three-dimensional network that guarantees their accessibility from the film surface. We demonstrate and quantify this accessibility using a surface-acoustic-wave nitrogen-adsorption technique. We use fluorescence depolarization to monitor the evolution of the mesophase in situ, and see a progression through a sequence of lamellar to cubic to hexagonal structures that has not previously been reported.