Remote detection of reactive analytes using optical films constructed from electrochemically prepared porous Si-based photonic crystals is demonstrated. Porous Si samples are prepared to contain either surface oxide or surface Si-H species, and analyte detection is based on irreversible reactions with HF(aq) or Cl2(g) analytes, respectively. HF dissolves silicon oxide from the porous matrix, causing an irreversible blue-shift in the resonance peak of the photonic crystal. Cl2 reacts with the native Si-H species present on the surface of as-etched porous Si to generate reactive silicon halides that evaporate from the surface and/or react with air to convert to silicon oxide. Either Cl2-related process reduces the net refractive index of the material that is detected as a blue shift in the spectrum. With sufficient analyte concentrations or exposure times, the spectral blue shifts are visible to the unaided eye. A portion of the porous nanostructure is filled with inert polystyrene, which acts as an internal spectral reference. The polymer fiducial protects that portion of the sensor from attack by the corrosive analytes. Reflectance spectra from both the polymer-filled and the unfilled, reactive porous layers are acquired simultaneously. The fiducial marker also allows elimination of artifacts associated with shifts of the resonance peak upon changing the angle of incidence of the optical probe. Theoretical angle-resolved spectra (transfer matrix method) show a good match with the experimental data. High-temperature air or room-temperature ozone oxidation reactions are used to prepare the HF-reactive surface, and it is found that the ozone oxidation reaction produces a greater sensitivity to HF (LLOD of 0.1% HF in water).