Php Variable Type Error Javascript