I need to pull a value from PHP and it works fine with the GET Object in fusion, but when I build, it doesn't work.
What's causing this and is there a way around it?
I linked an example that shows this.
Thank you
Get PHP in HTML5 Runtime.mfa
I need to pull a value from PHP and it works fine with the GET Object in fusion, but when I build, it doesn't work.
What's causing this and is there a way around it?
I linked an example that shows this.
Thank you
Get PHP in HTML5 Runtime.mfa
This isn't an issue with the Get object. It looks like it's an issue with the script you are executing on the server. The Cross-Origin request was blocked because the response data from the PHP script was missing the CORS header 'Access-Control-Allow-Origin'. You need to return this response header with your data so that the request isn't blocked. For example, the Newgrounds.io Gateway address (https://www.newgrounds.io/gateway_v3.php) returns some JSON data instead of rejecting the request because the gateway's PHP script has been set up to allow requests from remote origins. As long as you remember to have your script return that header with the rest of your response data, the GET request to that address from the Get object should work on the HTML5 runtime.
Some more information on the 'Access-Control-Allow-Origin' header: https://www.freecodecamp.org/news/ac...der-explained/
Here's how to add that header to a PHP script: https://enable-cors.org/server_php.html
Thank you, someone else is doing the php and they sent me their script listed below. What changes have to be made to it?
PHP Code:
<?
echo "YES";
?>
Do I just add-
header("Access-Control-Allow-Origin: *");
What site can I go to for free hosting so I can test out this php script?
Thanks
I added it to the php scripts and the .htaccess file, it's still not working.
Here's a link to the new version- http://form1generator.com/V8/
You should also post errors from console to have a better understanding,
starting from this:
Cookie “PHPSESSID” does not have a proper “SameSite” attribute value. Soon, cookies without the “SameSite” attribute or with an invalid value will be treated as “Lax”. This means that the cookie will no longer be sent in third-party contexts. If your application depends on this cookie being available in such contexts, please add the “SameSite=None“ attribute to it. To know more about the “SameSite“ attribute, read https://developer.mozilla.org/docs/W...ookie/SameSite
If you are planning to need this, it is very important to set up correctly.
Then i played a little bit with your website and moving ahead i got another error
GET http://form1generator.com/favicon.ico
[HTTP/1.1 404 Not Found 0ms]
checking what it is happening in detail, see headers and answer
GEThttp://form1generator.com/favicon.ico
[HTTP/1.1 404 Not Found 0ms]
GET
http://form1generator.com/favicon.ico
Status
404
Not Found
VersionHTTP/1.1
Transferred315 B (315 B size)
Referrer Policystrict-origin-when-cross-origin
HTTP/1.1 404 Not Found
Date: Wed, 26 Oct 2022 14:27:14 GMT
Server: Apache
Content-Length: 315
Keep-Alive: timeout=5, max=98
Connection: Keep-Alive
Content-Type: text/html; charset=iso-8859-1
GET /favicon.ico HTTP/1.1
Host: form1generator.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:106.0) Gecko/20100101 Firefox/106.0
Accept: image/avif,image/webp,*/*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: keep-alive
Referer: http://form1generator.com/V8/wizard.php
Cookie: PHPSESSID=1c1c3cc941cc7e741851e39e02a9beb2
could it be that cookie not set correctly get this error
Regards,
Fernando Vivolo
... new things are coming ...
I would really recommend that you use paid web hosting. The saying "you get what you pay for" also applies when you pay nothing. These free hosting sites always have some kind of limit. I'm currently hosting my zaptospark.com domain with a host called EthernetServers for $2.95 a month and haven't had any problems so far. If you're still set on free hosting though I do know of 000webhost (who are owned by Hostinger) and Byet Internet Services (they were used for the PHP registration tutorial on Clickteam's Tutorial page). It looks like both of them support PHP on their free plans.
Fixed!
Thank you everyone.
After adding the header, I could only get 1 of 4 values even though I was using 4 different get objects at the start of the frame. But regardless of the number of get objects it can only get 1 at a time. Doing them all at the start of the frame with "on get complete"; caused only 1 value to be recived and 1 or all my different fusion values to be set to the 1 get on complete.
So I made a cycle to go through each value at a time, not moving on to the next till the last get value was complete.
Noting this for future devs, it was simple, but a pain to figure out.
Thanks to the both of you!