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
1
Question by TheFrobster · Jun 14, 2011 at 07:15 PM · ioswwwdownloadwebphp

WWW Class behaves strangely on iOS

Hi,

I'm trying to execute a php script via the WWW-class in order to save highscores online. My code looks something like this:

 WWW download = new WWW( "http://www.serverxy.net/game/script.php?cmd=scores" );

It works fine on PC and Mac, but on iOS devices there seems to be a problem: The WWW-class doesn't execute the php script defined in the URL. Instead it downloads the index.htm found on the root-level of the server.

Thanks in advance!

Comment
Add comment · Show 1
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 BerggreenDK · Dec 21, 2011 at 07:10 PM 0
Share

not much help in here, I guess?

3 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by Simon Wittber · Feb 08, 2012 at 03:19 AM

The WWW class doesn't let you handle HTTP redirects yourself. UniWeb is a better HTTP api and will let you do this.

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 Jean-Fabre · Apr 09, 2013 at 09:38 AM 0
Share

ouch, I lost quite some time on this,as unity simply hangs without any notice or error as far my testing goes! thanks Simon!

avatar image
0

Answer by Dreamora · Dec 26, 2011 at 05:08 PM

The line there does not execute anything like that. Could you please post the rest of the code so its ensured you correctly execute WWW etc? (I ask cause I've seen people using WWW outside of coroutines which at times can work on the desktop or webplayer but will always fail on mobile where WWW will never immediately return - WWW always must be in coroutines and yield until they are done)

Just to mention that in case you search in other places: the WWW call never executes the php, its the apache server that would do it, all that WWW does is tell the server to do that and then it will return the echo that your PHP outputs, if there is one. But thats only a detail and not of relevance in this case as it works on PC / Mac

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
avatar image
0

Answer by davedev · Jan 19, 2012 at 01:45 PM

The call is probably getting redirected to "http://index.htm" because there's something wrong with "http://www.serverxy.net/game/script.php?cmd=scores" or maybe iOS mangles the url somehow, but the server probably gets a url for an invalid page and redirects it to index.htm. Does "http://www.serverxy.net/game/script.php?cmd=scores" work from the browser? Do you have access to the server logs that you can look at? Try a test php file at simpler url and see if that works.

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

6 People are following this question.

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

Related Questions

WWW request works in Editor but not in IOS? 1 Answer

About renting the host for the game 1 Answer

Download then open image on IOS 0 Answers

Invoke www.error in PHP 1 Answer

OutOfMemoryException when downloading files via the www class (iOS and Android) 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