Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Score upload from game created in AGK works ok to Internet hosted Mysql database, but when exported to HTML5 and uploaded to Internet host - scores fail to work with mysql database.

Author
Message
yoda333
12
Years of Service
User Offline
Joined: 3rd Apr 2012
Location:
Posted: 27th Apr 2019 02:30 Edited at: 27th Apr 2019 05:16
Hi
I've a score upload feature in a game created in AppGameKit that tests ok when running in AppGameKit, scores are sent and received to an Internet hosted Mysql Scores database, but when exported to HTML5 and the game is uploaded to the Internet host, the Scores database fails to work.

If I export the game as HTML5 to the desktop and run the game in the browser - the scores database updates ok. The scores database resides on the Internet host and is a Mysql database.

I'm thinking a webhost issue, but where to start?

I'm using source based on this article.

http://naplandgames.com/blog/2014/04/01/agk-tutorial-online-high-score-system/

Cheers
yoda333
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 27th Apr 2019 05:38
you don't need so many words in the description
fubarpk
fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk
Kevin Cross
21
Years of Service
User Offline
Joined: 15th Nov 2003
Location: London, UK
Posted: 27th Apr 2019 06:59
I didn't think any of the web/http commands work with an HTML export. The HTML exports are quite limited from what I've seen and heard. My app doesn't work at all in it.
OryUI - A WIP AGK2 UI Framework
yoda333
12
Years of Service
User Offline
Joined: 3rd Apr 2012
Location:
Posted: 27th Apr 2019 10:37
fubarpk

Apologies for the long question
yoda333
12
Years of Service
User Offline
Joined: 3rd Apr 2012
Location:
Posted: 27th Apr 2019 10:50 Edited at: 27th Apr 2019 10:59
Hello Kevin

Thanks for your reply.
I was thinking along the same lines that it wouldn't work.

I've just retested from a HTML5 export of the game from the latest version of AppGameKit to a folder on the desktop. (imac)
Scores are appearing at this test url when running the index.html file created after the export. So the HTML5 app is writing to the database on the webhost, when run from the desktop browser (Firefox).
I'm also closing AppGameKit totally before running index.html from the export folder.

https://puzzlemaker.000webhostapp.com/rockscores/getscores.php

A mystery at this stage.

The app lives here at the webhost
https://puzzlemaker.000webhostapp.com/

Cheers
yoda333
ApkGames.Guru
11
Years of Service
User Offline
Joined: 25th Oct 2013
Location: England, UK
Posted: 27th Apr 2019 20:54
@Yoda333 - I've many apps that use php/mysql to host scores and I find that when using them via html5, none of them perform as developed - I don't believe that html5 supports php.
yoda333
12
Years of Service
User Offline
Joined: 3rd Apr 2012
Location:
Posted: 28th Apr 2019 02:24 Edited at: 28th Apr 2019 02:28
Hi ApkGames.Guru

Starting to think it's a file dependency issue if I can post a score from HTML5 ok from desktop but not when uploaded to the webhost. Only other thing I can think of is webhost configuration (.htaccess/php configuration or directory/file permissions)

If I can read the database ok from here, i don't think it's file/directory permissions or php config.
https://puzzlemaker.000webhostapp.com/rockscores/getscores.php

Cheers
yoda333
yoda333
12
Years of Service
User Offline
Joined: 3rd Apr 2012
Location:
Posted: 28th Apr 2019 10:00 Edited at: 28th Apr 2019 11:05
Hi

Even though SetHTTPHost(cona , domain$ , 1) should set a HTTPS connection

Firefox shows a http mixed active content error (Blocked) from the firefox web console
When run from webhost in browser


Still an issue here even though working ok from an Exported HTML5 app folder from the desktop.
When run from desktop in browser (scores upload ok)


I'm suspecting a .htaccess modification may be required and there is an article here i need to investigate.
https://www.ipragmatech.com/enable-cors-using-htaccess/

I will let you know if I make any progress.

yoda333

Attachments

Login to view attachments
yoda333
12
Years of Service
User Offline
Joined: 3rd Apr 2012
Location:
Posted: 28th Apr 2019 22:34
Hello

Following modification of my .htaccess file as per information in the article at the webhost

https://www.ipragmatech.com/enable-cors-using-htaccess/

The scoreboard is working from the hosted webapp and the firefox webconsole shows no errors thrown when scores.php is being accessed on the webhost.

Cheers
yoda333 aka KingKappa
Kevin Cross
21
Years of Service
User Offline
Joined: 15th Nov 2003
Location: London, UK
Posted: 29th Apr 2019 00:02
Thank you for sharing @yoda333. I will have to give my app another go as an HTML export soon to see if it's work when hosted on a server, by amending the .htaccess file.
OryUI - A WIP AGK2 UI Framework
yoda333
12
Years of Service
User Offline
Joined: 3rd Apr 2012
Location:
Posted: 29th Apr 2019 22:10
Hello Kevin

All good and the website is working fine.

Cheers
yoda333

Login to post a reply

Server time is: 2024-11-22 21:15:05
Your offset time is: 2024-11-22 21:15:05