added php script and minor changes