I've had my compaq presario for a few years now, and for the past 2 the charging cord has not worked, I've had to re position it constantly. My current short term solution is duct tape. Have you found a solution to this problem? I know its not just me who has come across this issue.
The most common cause of this problem is an open circuit on the DC jack of your AC adapter. You can get a brand new AC Adapter for most laptops on Amazon.com for under $10. The second most common problem is the connector pins on the DC plug getting loose from their soldered thru-holes in the motherboard. If you are comfortable taking the laptop apart to the point where the motherboard is taken completely out, you can turn the motherboard over and re-solder these pins (you need a good soldering iron and a steady hand). That isn't for the faint-hearted, even though you may be able to download a service manual that gives you step-by-step procedures. Otherwise, after you've tried the cheaper alternative (buying a new AC/DC adapter), you'll need to take the laptop to a reputable laptop service center, but expect to pay a bit for the labor.