1) You need to understand some basic home electrics. If you are not able to create simple extension cord from parts, please don't try it. It's really not worth to get electrified.
2) Whole idea is pretty simple: make an extension cord with remote switch of phase line. In our country there are three lines in extension cord, but after pluging it into socket, only one of them is "alive". That one needs to be cut and lengthen to the switch. I was considering extension cord with build-in switch, but it would mean too much cables through my room. I also didn't want to change cabling of the lamp.
3) You need: dismantleable male plug, dismantleable stand-alone outlet, 3 line cord (for extension cord), 2 line flat cord (for switch), leg switch, pliers, screwdriver, electric isolating tape and electric tester. Both cords shlould have same diameter of lines. Lengths of cords are up to you, consider your situation and needs.
4) See the "schema" and get parts together. Think about "alive" line. If it's on the left/right side of wall outlet, it must be on the same side of cord outlet. Isolate connections, check functionality with tester and plug it between the lamp and wall.
5) Enjoy ;)