Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by zak666 · May 11 at 08:58 PM · mysqlregistercryptography

Unity is not sending password to my PHP. but registers account Hash 0, Salt, 0 ? ?

Hey everyone! OK so it mostly works, it registers an account in my database, however $password is empty, so it encrypts nothing. no idea why it's not sending the password in the field. the Salt and Hash outputs as 0 and 0. but for some reason $password is empty so its encrypting nothing.

this is what I get after it registers. yes it dose register and create an account but... ID: 12 username: test hash: 0 salt: 0

hash and salt should not be 0.

yes everything is set up correctly. :)

 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 using UnityEngine.UI;
 using UnityEngine.Networking;
 using TMPro;
 public class Registration : MonoBehaviour {
   
     public Text nameField;
     public Text passwordField;
 
     public string username;
     public string password;
 
     public GameObject CanvusLogginRegister;
 
     public void CallRegister() {
 
         username = nameField.text.ToString();
         password = passwordField.text.ToString();
 
 
         StartCoroutine(Register());
     }
 
     IEnumerator Register() {
         WWWForm form = new WWWForm();
         form.AddField("name", username);
         form.AddField("pass", password);
         Debug.Log("" + form);
         UnityWebRequest www = UnityWebRequest.Post("https://mysitehere.com", form);
         yield return www;
         if (www.isNetworkError || www.isHttpError)
         {
             Debug.Log("User creation failed. Error #");
           
            
         }
         else
         {
             CanvusLogginRegister.SetActive(false);
             Debug.Log("User created successfully");
             Application.LoadLevel("LoggedIn");
         }
     }
 
     public void VerifyInputs()
     {
      //   submitButtion.interactable = (nameField.text.Length >= 8 && passwordField.text.Length >= 8);
     } 
     
 }

alt text

alt text

capture.png (40.2 kB)
capture1.png (15.5 kB)
Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by Bunny83 · May 12 at 03:16 AM

First of all get rid of your query string and look up how to use prepared statements. Both of your queries are vulnerable to sql injection.


About your actual issue, it's not really clear from your description what is happening. Your php script also is quite inconsistent with the use of "exit" and "die". USing the construct or die has many issues as it does not properly handle all possible errors. If the actual command causes an error, the script would just crash. Also die / exit does not cause an error, it just exits the script immediately but adds some additional string to the output before exiting when using a string argument. So you can not detect those exit methods as an error on the Unity side unless you would interpret the returned string. So this would neither result in a network error or an HTTP error.


we can't really help you with debugging on the php side. There are countless possible things that could cause issues. Maybe the generation of the super global $_POST is disabled on your server? You should echo some debug strings and actually read those on the Unity side in order to know what happens on the PHP side. Also checking the error log on the server may also help.


You may temporarily add those lines at the top of your script:

 ini_set('display_errors', 1);
 ini_set('display_startup_errors', 1);
 error_reporting(E_ALL);

This should make php actually return error texts. In production those should be disabled as they are a general security issue. However for debugging this is quite useful.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image zak666 · May 16 at 11:17 PM 0
Share

hey thanks buddy (thanks buddy I'll do that) just wasn't sure why I was getting 0, 0 :) I'll go look into that following a tutorial I saw on YouTube to try and get something simple set up :)

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

138 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How do I add login and register? 1 Answer

I can't register the unity 0 Answers

Problem for account creation system 0 Answers

Problem with mysql between CS and JavaScript 2 Answers

How to Pass a static var in Javascript value into a c# or download mysql text data using c# 5 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges