• 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 ramonfr · May 09, 2013 at 04:26 AM · networkdatabasebrowserphp

Script works on Unity3D but not on the web page.

Hi there, I have a script that calls a php page, then the php page calls a database.

Everything works fine when I run the application INSIDE the Unity editor, but when I compile the standalone to web browser, it seems that the game can't access the php page.

It used to work just fine in the previous versions of Unity, it's the first time I try something like this in the new version and I'm having this problem.

Yes, I created the crossdomain.xml and placed it inside the proper folders.

Comment
Add comment · Show 4
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 Graham-Dunnett ♦♦ · May 09, 2013 at 01:49 PM 0
Share

So, what errors do you get? What makes you say that it doesn't work? Does your web server log show that the webpage has asked for the php file?

avatar image ramonfr · May 09, 2013 at 09:42 PM 0
Share

I don't get any error; the page simply doesn't return any result. The following image can show it:http://i43.tinypic.com/2afxyc1.jpg . I'm figuring out how to read the web server log.

avatar image ramonfr · May 09, 2013 at 09:49 PM 0
Share

The log shows that the webpage hasn't been asked when I ran it from the browser, but it was asked when I ran the game from the editor. 127.0.0.1 - - [09/$$anonymous$$ay/2013:16:47:36 -0500] "GET /game/login.php?username=p1&password=123 HTTP/1.1" 200 9 "-" "UnityPlayer/4.1.2f1 (http://unity3d.com)"

avatar image EpicGamer928 · May 10, 2013 at 07:17 PM 0
Share

I think I know what's up. Unity might be able to access the php and database offline, but everything's different in the live environment. (On the actual website) The website might not be able to reach wherever you have got your php, especially if it is stored on your computer. Try checking that your files are at a reachable location. Like on a hosted website or online storage.

0 Replies

· Add your reply
  • Sort: 

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

15 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

Related Questions

Database and Unity 0 Answers

Connecting to Asset Server >> ERROR: could not open relation 1663/35864/16558: No such file or directory 0 Answers

Unity - MySQL data loss 0 Answers

Best way of storing userdata [Multiplayer] 1 Answer

Why i keep getting this message : Wrong response ? 0 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