The method of ab initio molecular dynamics, based on finite-temperature density-functional theory, is used to study the nonmetal-metal transition in two different metal-molten-salt solutions, Kx(KCl)1-x and Nax (NaBr)1-x. As the excess metal concentration is increased the electronic density becomes delocalized and percolating conducting paths are formed, making a significant dc electrical conductivity possible. This marks the onset of the metallic regime. By calculating several electronic and structural properties, remarkable differences between the two solutions are observed. The anomalous behavior of Nax(NaBr)1-x, typical of all the Na-NaX solutions, is found to be related to the strong attractive interaction between the sodium ions and the excess electrons.