Updated script for use with PHP stock page