Electrical issue when starting on 2003 Volvo S40

When I put the key into the ignition, the headlights and dashboard lights light up...But when I try and start the engine---the headlights and dashboard lights just flicker on and off and engine will not start?

Asked by for the 2003 Volvo S40
Sounds like a discharged or failing battery or bad connections at the battery terminals.
Thanks for the reply...(Oh...I also forgot to mention that when I jump started the battery...was able to drive...but about 20-30 minutes after I arrived home and tried to re-start...I encountered the same problem as above...) Does this further confirm failing battery...
1 more answer
Have the charging system checked out, but also have a Volvo shop check the immobilizer system.
(The immobilizer is the security system where you have a microchip in the key that prevents someone from starting you car with another key)