In this paper we review the luminescence properties of porous silicon layers formed on p-type silicon substrates and subsequently oxidized by anodic polarization in an aqueous electrolyte. The electrochemical oxidation of the porous material leads to a large increase in the photoluminescence intensity, accompanied by a blue shift of the emitted spectra. A bright visible electroluminescence is also observed during anodic treatment, with characteristics showing similar trends to that of the photoluminescence. The features of the emission are analyzed using a model that expresses the energy dependence of the emitted intensity. The model is developed on the hypothesis that the visible light emission originates in the confinement of charge carriers in the quantum-sized crystallites which form the material, and that its efficiency is determined by nonradiative processes, which involve the carrier escape from the confined zone where they are created (or injected) through a tunnelling mechanism. This model is shown to be well supported by the experimental results, and allows an understanding of the spectral shifts and the intensity variations of both photoluminescence and electroluminescence during electrochemical oxidation of the porous layers.