Try the default security code 12345. If it is not accepted, your phone needs repair. See the repair options for further assistance.
If you reset your phone, the code is set to undefined, or reset to 12345. To set the code again or change the code, select Menu > Settings > Security > Access codes > Create security code or Change security code.