2002 cavalier have no headlamps only high beams when put into gear low beams flash and service light comes on?

It is a wiring problem. My mechanic followed the wiring and found where it had frayed. He spliced the wire, removed the headlight and soldered it back on. Works like new now!