Moving path definition to PHP from JS