moved curl request to php script called by embeded javascript