updated php script for titles