I want to implement a salt into my login system but am a bit confused on how this is supposed to work. I can\'t understand the logic behind it. I understand md5 is a one-way
Forget about using salts (partly for the reason you mention), use bcrypt instead:
For a good explanation see: http://codahale.com/how-to-safely-store-a-password/