Locker alarm

I want to know how to make a song play every time i open my locker using my mp3 player and please keep it under $30

For $5, you could get a musical greeting card. Tape one side to the inside of the locker near the door. Tape an L bracket to the door and tape the other half of the card to the L bracket such that the card is clsed when the locker is closed. When the locker opens, the card will play.

This does not use your MP3 player, but it is simple and cheap, and there are a variety of songs available on the singing greeting cards.
+1
Easiest and most simple solution would be to use one of these 9V recording module. Replace the play/pause button with a micro switch so when the door is closed the music is paused. When you open the door the music will start to play. Record whatever ti is you want to play and your all set. 

Trying to adapt an existing MP3 player to do this will likely cause you to destroy the player or spend way more then $30. 
+1