I have already discussed some of the connections between Lockhart and Slughorn, but I want to glance briefly at some contrasts that exist between Dumbledore and Lockhart in Harry Potter and the Chamber of Secrets. This is an unusual contrast, and so you will have to bear with me as I develop the argument.
Dumbledore’s role in Chamber of Secrets is primarily to get suspended so that he can tell Harry that help at Hogwarts will not be refused to those who ask for it. This line is called back in the climactic confrontation in the Chamber when Harry asks for help and Fawkes is sent to his aid with the Sorting Hat, from which he is able to pull the Sword of Gyffindor from the hat’s depths. In short, Dumbledore is there for Harry when he needs help. Dumbledore has symbolically come to Harry at the darkest hour in an act of rescue.
Now, let’s look at Lockhart. Gilderoy is incompetent as a wizard, arrogant, oblivious and utterly consumed with his own image and press clippings. That’s already quite the contrast to Dumbledore who is a skilled wizard, humble, alert and selfless. Moreover, Lockhart is a picture of empty celebrity constantly concerned with how he “looks” on the front page. Dumbledore, on the other hand, actively lays down his reputation when he leaves Hogwarts after being suspended, making no effort to defend himself from Malfoy’s slanderous allegations of incompetence and “getting old.”
But Gilderoy functions in the story so that he can try to run when Ginny has been taken into the Chamber to be killed, exposing himself to Harry and Ron as a fraud. Thus, Lockhart is contrasted with Dumbledore at the core of the story. Lockhart goes with Harry unwillingly into the Chamber where Dumbledore comes willingly at Harry’s cry. Lockhart uses his magic selfishly in the Chamber in an attempt to modify Harry and Ron’s memories so he can escape with another dramatic story for his fans. Dumbledore employs his magic selflessly to help Harry. Lockhart intends to erase Harry and Ron’s memories and escape without rescuing Ginny, leaving her to die. Dumbledore throws his lot in with Harry to save Ginny and believes Harry’s tale and thus affirms his “memories” of what happened.
Thus Dumbledore and Lockhart are contrasting examples of loyalty and disloyalty, selflessness and selfishness.