switched js to php