What is the model number of your dryer? You can find the full model number on the model/serial number tag that is located on the dryer.
Your model number should start with three digits, then a dot followed by eight more digits. For example, 123
From what you described I would suspect a bad door switch.
When you open the door to look for that model number take a look for the door switch.
There should be a little tab or button that the door hits when it closes. If it's not broken off you should be able to push it in with your finger to see if you can hear it click on and off.
Don't forget to get us that model number.