Self user creation script is not working on mobile

So i have this script for creating self user through sign up , It is working on desktop but not on mobile , Why?

pastebin.com/WCtASfyX

Since the script is big , I have pasted in on Pastebin .

Any help would be highly appricated. Thanks