Surface and bulk interactions of ionic and nonionic surfactants