How to access microsoft Active Directory in Linux with c or php language

view story

http://stackoverflow.com – I am on a Centos linux os , and there is a MS 2008 Server in the same LAN , on the Server I install Active Directory Server , The question is how can I access MS Active Directory in Linux , I mean the way use C or Php language . I want write a program ,the program can manipulate MS Active Directory Its main function are : add - del user, edit user password What should I do ? (HowTos)