Can you a php script on the same page with ajax?

Please Note
This discussion was started to find what search terms to use.
The steps involved are being discussed here