It sounds like you probably have two problems, the lose wire or loose bulb, and the parking brake light switch itself. The parking brake light switch is attached to the parking brake actuating mechanism. It is pretty hard to get to under the dash. The most common problem I have found when the light stays on is that the switch is either bent up or it has rotated away from the little nub that opens the switch to turn off the light.
This thread has some pictures of the switch or at least a similar one. https://cccforum.discoursehosting.net/t/made-a-parking-brake-warning-today/8697/1