Car stopped at red light tonight, engine still running?

I have a 1997 Honda Civic. Anyone know what this problem could be and if it's worth fixing?

I was at a red light but when I hit the accelerator to go forward it wouldn't move. I restarted the car, it worked, and drove about a tenth of a mile before the car just stopped going forward again. Fortunately I did this a few times and managed to get home since I was only like a mile from the house.

Basically… If you push on the gas the engine revs up, but when you put it into drive, nothing happens. But if you turn it off for a few minutes and restart, you can get the car moving for maybe 20 to 30 seconds and then it stops moving again (as though someone threw it into neutral)… But the engine is still running.

I'm going to have it towed to a dealer in the morning and have a feeling this car is done for. Any possible last thoughts before I throw down money on a new car?

Added (1). Oh, the engine light was on, too.

Check your oil and your transmission fluid level