This cheat requires that you have not fought the man to the left of the end of Nugget Bridge (just like in the Mew glitch) and have not fought the trainers to the East of Vermilion City, and have a Pokemon with Teleport or Fly. (I recommend catching an Abra, just south of Cerulean City, since you can get these pokemon early in the game).
Go to where the man to the left of Nugget Bridge is just one step down from your screen (you'll be one step to the left of the top edge of the lake). Tap
Down press
Start then select your Abra (or flying Pokemon) and
Teleport or fly back to the PokeCenter in Cerulean City. You should see his "!" appear over his head, but teleport any. Then go through the house where you got the TM Dig from the Rocket. Go south and travel to the tunnel that connect Cerulean City and Vermilion city.
Do not go into Vermilion City PokeCenter Leave, and go down and then turn right. Walk past the dock, and past Diglett's cave. Then you will be in an area with lots of trainers and grass. Following the paths, avoid the trainers. Go to the very last trainer (and old man guarding the entrance to a building) and walk two steps away from him. Get into a fight with him, then defeat him. Teleport back to Cerulean City and walk up Nugget Bridge. 4 or 5 steps after the background changes color your start menu should pop up, press
Start to exit out of it and you will get into a fight with a wild lvl 7 Magmar. Damage it and capture it with a Pokeball. You can use this trick on many different trainers to get other rare pokemon at lvl 7, such as Chansey, Mew, Rhyhorn, Staryu etc.
WARNING! Do not save your game between the time you teleport away from the man near Nugget Bridge and the time you fight Magmar! Your game will not respond well
Trouble Shooting
Q: I fought the man, but a different Pokemon other than Magmar appears!
A: This is error on my half. You see, I haven't recorded which trainers give what. Although I am fairly certain that Magmar is from the old man, I am not 100% sure. You may want to try other trainers in that area. You'll probably run into a few other rare pokemon too.
Q: I fought the man near Nugget Bridge already, what do I do?
A: You'll have to live without Magmar unless you trade it from another game. Or start over and get your pokemon.
Q: I accidently killed Magmar, what do I do?
A: Do not save, and just restart and try again. If you've already saved, you can try to find other trainers (if you don't mind walking a lot) and see if any of them give you Magmar. I can guaruntee you'll get some cool pokemon though.