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 Eidern · Feb 17, 2016 at 08:09 AM · c#wwwsql

WWW with php file cannot sent more than 6 values ?

Hello, I'm inserting new entries in a tables with a php script, and i'm passing values to this script with unity. Everything works fine, until I'm sending more than 6 values at same time ? here's my code :

 IEnumerator InsertRequest(){
 insertLink += "?lat="+baseController.lat
             +"&lng="+baseController.lng
             +"&etat="+baseController.etat
             +"&nom="+baseController.nom
             +"&espece="+baseController.espece
             +"&taille="+baseController.taille
             +"&race="+baseController.race
             +"&poils="+baseController.poils
             ;
         print (insertLink);
         www = new WWW(insertLink);
  
         //Load the data and yield (wait) till it's ready before we continue executing the rest of this method.
         yield return www;
         if (www.error == null)
         {
             //Sucessfully loaded the JSON string
             Debug.Log("ok");
         }
         else
         {
             Debug.Log("ERROR: " + www.error);
         }
 }

it debugs "ok", but don't do the entry in the database? There's more , if i manually copy/paste the link outputed by the (print(insertlink)) in a browser, the request is ok and the entry in the database is done. Weirder : if in the unity script i only pass 6 parameters(in this example i don't pass "race" & "poils" params, it's working and the entry in the database is done !

How can it be possible?

Comment
Add comment · Show 3
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 alankemp · Feb 17, 2016 at 12:08 PM 1
Share

Does baseController.taille contain any special characters? If it includes a space or quote it might be the rest of the URL isn't well formed. You might need to URLEncode the parameters.

When you paste it into a browser, the browser fixes it and sends the whole thing

avatar image Eidern alankemp · Feb 17, 2016 at 01:59 PM 0
Share

In fact, I said 6 params because I made multiple tests, if i pass vars until "espece" var, it's ok. if i go until "taille" , it doesnt work, BUT if i don't pass the "espece" var but i pass "taille" ins$$anonymous$$d : it works too ..

avatar image Eidern alankemp · Feb 17, 2016 at 02:12 PM 0
Share

So I guess my problem is server sided ? Can you show me the part of your php request file that receive the vars?

1 Reply

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by Eidern · Feb 17, 2016 at 11:20 PM

Someone found the answer on another post , So I give it for those who can have the same problem.

The URL got a character limit, so if you pass long var names, with long values, at a point you'll get this error too.

You'll have to switch to a WWWForm method and use POST, instead of GET in your php file to retrieve the values.

 WWWForm form = new WWWForm();
         form.AddField( "lat", baseController.lat.ToString());
         form.AddField( "lng", baseController.lng.ToString() );
         form.AddField( "etat", baseController.etat );
     //and so on...
         // Upload 
         WWW w = new WWW(insertLink, form);
         yield return w;
         if (!string.IsNullOrEmpty(w.error)) {
             print(w.error);
 
         }
         else {
             print (w.text);
         }
     
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

95 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

Related Questions

Multiple Cars not working 1 Answer

Distribute terrain in zones 3 Answers

Making a bubble level (not a game but work tool) 1 Answer

WebClient on Android 0 Answers

An OS design issue: File types associated with their appropriate programs 1 Answer


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