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 Itinerant · Mar 15, 2013 at 10:01 PM · wwwphppostopenurl

Combine OpenURL with WWW post?

I have a php page that, when called with the correct POST commands, downloads an excel spreadsheet. The trouble is, if I call it via WWW the page doesn't open, and thus the spreadsheet isn't downloaded. If I open the page via OpenURL, it doesn't receive the POST. Is there any way to combine these two functions?

If it matters, I'm using PHPExcel to generate the spreadsheet.

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 stephane.cottin · Mar 18, 2014 at 06:48 PM 0
Share

No way in the Unity webplayer to do like a simple HT$$anonymous$$L post form ? We need to do it with sending BinaryData ...: at the end of the application got to a blank page with POST action .. (and not sending wia httprequest and waiting for callback response )

avatar image robertbu · Mar 18, 2014 at 06:49 PM 0
Share

@stephane.cottin - better to ask this as a new question rather than a comment on an old and answered question.

avatar image DennisFloab · Dec 17, 2021 at 09:50 AM 0
Share

BI.ZONE: expert in digital risks management.

From corporations to start-ups, we help organizations around the world to develop their business safely in the digital age.

2 Replies

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

Answer by Itinerant · Mar 18, 2013 at 08:34 PM

Alright, still not quite sure how to do this, but I figure I should share my workaround for anyone who finds this. (Note that this only works if can add code to the site that the unity3d file is being hosted on, but that should be fine in most cases.)

Forget about WWW. Use Application.ExternalCall() instead. Here's how I did it:

On the html page holding the player, set up a form. Set up a hidden iframe, pointed towards the php that should accept the POST. Write a javascript function with as many arguments as you need. Have it assign the arguments to form values, then submit the form to the hidden iframe.

Now, in Unity, convert whatever data you want to POST to a string. Use Application.ExternalCall(yourJSfunction, yourdata1, yourdata2, etc) to send the information to the webpage, and have that javascript function take care of the rest. Looks like it's working pretty well.

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 djirving82 · Nov 14, 2019 at 05:02 AM

Sorry about the necro, but I was directed to this data, so others may see it as well. I suggest using OpenURL and adding your intended post data to the address. Then Use $_GET to grab the data from the address.

Example URL: "https://example.com/test.php?N=Thomas"

The $_GET in PHP would look like this:

$Name = ""; if(isset($_GET["N"])){ $Name = $_GET['N']; }

Then you can use the $Name variable for whatever you want in PHP

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

13 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

Related Questions

Using POST/GET from JavaScript in Webplayer to .php file; How do I set up the data in the php file that is to be transfered? 1 Answer

PHP POST through $_REQUEST with WEBBUILD 1 Answer

About renting the host for the game 1 Answer

How to debug php code when use www to communicate with server side. 0 Answers

How do I make a simple POST request to Amazon S3? 2 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