updated php with javascript