Embed on my website but protect access

Ideas and discussion about publishing and distributing your games

Post » Fri Feb 20, 2015 11:01 pm

Hi

I have a few projects made in construct 2 that I would like to publish on my website, but in a protected manner.

You need to be a user of the site to access the construct 2 "games".
Normally this is easy on a wordpress site.

My problem is that the only way I have been able to include the construct 2 games on the site, is within an iframe.
And this makes it possible for anybody to grap the url of the iframe and access it directly, without having to be a user of my site.

Have anybody solved something like this? Embedding construct 2 games / projects but with a controlled access?
B
5
S
1
Posts: 59
Reputation: 493

Post » Sat Feb 21, 2015 10:42 am

B
32
S
10
G
3
Posts: 310
Reputation: 6,101

Post » Sat Feb 21, 2015 10:44 am

If you have a user login status with PHP or something, manually add the checks to the exported index.html document and change the extension to .php.

You could add the check at the top of the file, something like


ie

if($userloggedin = 1){

//rest of the original html file content

} else {

header(location: http://someURL);
}
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,592

Post » Tue Feb 24, 2015 8:51 pm

stctr wrote:Like this?

Framed access : https://weebe.nl/frametest.html
Direct access : https://weebe.nl/protectedgame/index.html



Yes Stctr... Something like that :-)
B
5
S
1
Posts: 59
Reputation: 493

Post » Wed Feb 25, 2015 1:48 pm

https://www.scirra.com/tutorials/1390/l ... your-games

Change document.domain to document.referrer
B
32
S
10
G
3
Posts: 310
Reputation: 6,101


Return to Distribution and Publishing

Who is online

Users browsing this forum: No registered users and 0 guests