We present simple, practical codes designed for the binary and Gaussian dirty-paper channels. We show that the dirty-paper decoding problem can be transformed into an equivalent multiple-access decoding problem, for which we apply superposition coding. Our concept is a generalization of the nested lattices approach of Zamir, Shamai, and Erez. In a theoretical setting, our constructions are capable of achieving capacity using random component codes and maximum-likelihood decoding. We also present practical implementations of the constructions, and simulation results for both dirty-paper channels. Our results for the Gaussian dirty-paper channel are on par with the best known results for nested lattices. We discuss the binary dirty- tape channel, for which we present a simple, effective coding technique. Finally, we propose a framework for extending our approach to general Gel'fand-Pinsker channels.