In this research study, we developed a convenient method for detecting the residue of sulfonamides in water samples using a manual injection valve, octyl (C8) as the sorbent in a solid-phase extraction column, high-performance liquid chromatography, and a diode array detector. Use of gradient flow for a solvent pulse can prevent the use of a second pump and a switch valve. This reduces the cost of instruments. Under optimal conditions, the limits of detection ranged from 0.54 to 3.67 μg L-1, and most drugs had a good relationship (R2 > 0.995). Moreover, during method validation, relative standard deviations for interday and intraday precision ranging from 0.3% to 12% and from 0.1% to 5.4%, respectively, were observed. This method was used to detect sulfonamide residues in environmental water, and the results indicate that neither of the two rivers we studied contained sulfonamides.