Javascript and PHP modes