You can try holding option whilst booting, when the disc option comes up try to eject. If that doesn't work, you can try to knock it out by holding the macbook with the dvd slot facing the ground and then quickly moving the macbook up and down in a jerking motion ( this does work, just make sure you have a good grip ;) Good Luck
Sometimes these symptoms can occur from water damage to the dock connector area and/or corrosion in and around the dock connector from humidity/moisture. You can try to clean the dock connector with some alcohol on a cotton tip but this does not always work, your best option would be to examine the extent of internal corrosion and replace your dock connector.
You need to do a DFU Restore,
1. Connect the device to your computer
2. Shut down the device
3. Press the Power and the Home buttons at the same time
4. After 10 seconds release the Power button but continue holding the Home button
until you see a popup from iTunes saying "iTunes has detected an iPhone in recovery mode"
5. If you have been successful your device screen will be completely black/blank (this is 'DFU Mode')
6. You can now proceed and restore to the latest firmware using iTunes This should fix your problem