Php cross-domain enable <Solved>

Get help using Construct 2

Post » Mon Oct 20, 2014 11:32 am

Using Ajax I'm trying to get data from a php file with no results. Since the php file is in another domain I guess I have to enable Cross-domain. I try header('Access-Control-Allow-Origin: *') but it does not work.

It would be nice to have the source code of a working php file
Does any of you have a working example of that????

Thanks in advance!
B
4
Posts: 16
Reputation: 232

Post » Mon Oct 20, 2014 2:20 pm

Ohh how easy it was!

This is my Php code

<?php
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: GET, POST');
echo "Hello World";
?>
B
4
Posts: 16
Reputation: 232

Post » Mon Oct 20, 2014 4:49 pm

jquery (that comes installed with C2 games) supports the jsponp request type as well.
Developing Surolace, the survival role playing space game.

surolace-survival-role-playing-space-game_t116953
B
14
S
4
Posts: 303
Reputation: 1,730


Return to How do I....?

Who is online

Users browsing this forum: Google [Bot] and 22 guests