Extracting Javascript and PHP