ok i have edited the script and let me tell you that u am a newbie in php
and as far as problem is concern i think either its cookie problem or session problem
but i really dont know how to use them correctly!!
here is page 1 named cap.php- http://pastebin.com/ZHE0BJku
here is page 2 named play.php- http://pastebin.com/1VNgMEcQ