You could just make it a point to check to make sure that the headlights are off before you get out of the car.
Im not sure where the sensor/alarm is located to make the noise, but it most likely went bad and needs replacement. If you pull up a circuit diagram, it should be tied into the door open switch.
You can test if the sensor died using this guide. If the sensor still works, maybe it's the bell/ringer. I don't know were that is, probably in the dash somewhere.
before you go off and check the "noise maker" (which is behind your center console) check if your dome light(make sure the bulb works by turning it on manually) turns on when you open the door or if it flickers. If it stays off or flickers it might be the sensor on your door.(that black plastic thing that sits in the door jam below the hook your door latches on to)
have your keys in the ignition turn on your head lights and have your dome light on the "door" position.
Now wiggle the sensor (little black hook) and see if it makes a difference.
should be an easy find and an easier fix.
If this is not the problem I am sorry and I've done all i can.
I was finishing my alarm install tonight and when I drove home, I noticed that my "ringer" stopped working, too. It may have just been an anomaly but I'm going to look under the dash soon. I'll let you know what I find.