Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 N1warhead · Apr 25, 2017 at 05:15 AM · wwwphpwwwformwww classwww.error

WWW Class is acting up

Hey guys, I'm completely confused. I've got like 6 PHP Scripts working fine, but this one just doesn't budge and I'm completely not understanding what's going on.

The PHP WORKS (ON THE SERVER), but for some reason in Unity I keep getting the error (At the bottom of this question).

Being it works on the server - I am not getting any error_logs to read. It works perfectly fine on the server, but I keep getting some HTML Errors. (When there isn't even a tiny piece of HTML anywhere).

Here's the PHP (I'm doing it the same exact way as I am with other scripts), so I don't know what's going on.).

     //Connection
     $conn = new PDO ("mysql:host=$servername;dbname=$dbName", $server_username, $server_password);
     $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
     
     //Check Connection
     if(!$conn){
         die("Connection failed.");
     }
     
     $username = ($_POST['usernamePost']);
     $password = ($_POST['passwordPost']);
     //$ts = gmdate("Y-m-d\TH:i:s\Z");
     $rowE = "";
 
     
     // We select the HASHED password inside the database, then we feed it our password from Unity,
     // Then we use password_verify at the bottom to determine if they are matched.
     if($stmt = $conn->prepare("SELECT Password FROM Acts WHERE User=:User")){
     $stmt->bindParam(":User",$username);
     $stmt->execute();
     // Result = the HASHED password, this will not give out an unhashed password.
     $result = $stmt->fetchColumn();
     }
     
 
     
     // Now we verify it.
     if(password_verify($password,$result)){
         // Load the saved data to the users device.
         if($stmt = $conn->prepare("SELECT Timestamp FROM Saves WHERE User=:User")){
         $stmt->bindParam(":User",$username);
         $stmt->execute();
         $rowE = $stmt->fetchColumn();
             if(!$rowE){
                 echo'No Data Found.';
             }else{
                 echo $rowE; // <<<<<< THIS WORKS ON SERVER.
             }
         }
     //    die('Verified'); // password MATCHES (HASH) (LOGIN SUCCESSFUL!) - Tells Unity.
     }else{
         die('Incorrect');// Tells Unity it wasn't successful, so to try again.
     }
 
 ?>






I keep getting this error.

 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 <html><head>
 <title>500 Internal Server Error</title>
 </head><body>
 <h1>Internal Server Error</h1>
 <p>The server encountered an internal error or
 misconfiguration and was unable to complete
 your request.</p>
 <p>Please contact the server administrator,
  webmaster@stonervillevalley.warhead-designz.com and inform them of the time the error occurred,
 and anything you might have done that may have
 caused the error.</p>
 <p>More information about this error may be available
 in the server error log.</p>
 <p>Additionally, a 500 Internal Server Error
 error was encountered while trying to use an ErrorDocument to handle the request.</p>
 </body></html>
 
 UnityEngine.Debug:Log(Object)
 <RemoteUplink>c__Iterator0:MoveNext() (at Assets/Imported/Scripts/DataPersistence/LoadGame.cs:56)
 UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
 
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
Best Answer

Answer by N1warhead · Apr 25, 2017 at 05:27 AM

Omg every time I ask a question i figure it out within 5 minutes, after searching for hours.....

Sorry guys.

Turns out - don't ever use public variables for things you don't need too, because as usual - I forget they don't update values in the inspector once it's added to object.

Sorry guys.

Hope that helps you for anyone facing this issue.

Comment
Add comment · 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

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

67 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

Related Questions

Why isn't this $_POST working properly? 1 Answer

WWWForm.Addfield not able to post data to server 1 Answer

wwwform send an array the right way! 0 Answers

Use the data received from WWW in UI 1 Answer

Problem using WWW with PHP and MYSQL 3 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