If I try wget it downloads the resolved page. But I want to download the original script. Is this possible?
wget
This is not possible, the webserver doesn't output the PHP script. The webserver parses it serverside and writes the response of that to the client.