If you look on w3schools there is a sample JS file for use with PHP.
Have a look about, it basically retrieves data from your php page, sends it onto the php file you designate, which then processes it, and echos back the result, the JS file then updates the named html object you give it with the echo'd result from your php file.
I deleted my ajax site recently as its not ideal for most websites, but search for things like 'Ajax javascript and php' or something or on W3Schools, its a good tutorial =]