Show us the code that you tried. Describe what the code actually does and how that differs from what you want to do. What, specifically, do you need help with.
Before posting code, please read the "how to use the forum-please read" stickies to see how to format and post code.
The serial input basics thread might be of interest.