Can we slow down just a bit? We need to focus on one problem at a time.
This line: $password = password_hash($password, PASSWORD_BCRYPT, array(‘cost’ => 12));
takes the unencrypted password once it’s in PHP and makes a one-way non-reversable hash string that you store in the database. That way if a hacker compromises your database, they in theory cannot reverse the passwords. That’s the purpose of that line. But this is only important AFTER the PHP script gets it.
Between your app and your script, you’re transmitting data over the Internet. I don’t know if your URL starts with http:// or https:// since you’re not sharing your real URL. But if it’s http:// and you use: http://mysite.com/myscript.php?username=fred&password=bedrock&password2=bedrock&email=fred@flintstone.com and you use network.request() with that URL
That entire string is visible to any one with a packet sniffer running on their computer connected to the same network.
If you’re using https:// then you’re all set. The network traffic is encrypted before it’s sent and the server decrypts it and you don’t have to worry about it. But if you’re using http:// you really should hide that data behind some obfuscation: i.e. changing the key’s to something other than “username” and “password” and base64 encoding the values.
If you do this, you must change your PHP script to match.
Hopefully that explains it to you.
Now are you including “password2” on your URL? Did you change your PHP script from $_POST[‘password2’] to $_GET[‘password2’]?