How to send a variable to a php ?

Get help using Construct 2

Post » Fri Dec 09, 2011 12:38 am

Hello I have a page called index.php its a game made with C2 but in the foot of this same page I added a code in php. my question is when I select an object image for example picture1 it will send to the same page index.php an variable and after request it to inside to my code index.php for print in it.

---index.php----
game in Construct2:
picture1 (var1)
picture2 (var2)

Inside to my code php, how to request var1 or var2, I have it but I dont know how to send by C2.

<?php
$myvar= $_GET["var1"];
echo $myvar;
?>

----end index.php-----

I hope you understand me my english is poor :(

Thanks
Gustavo

B
33
S
3
G
5
Posts: 44
Reputation: 5,058

Post » Fri Dec 09, 2011 12:46 am

There are examples (C2 and PHP) listed in the how do I FAQ under the section AJAX. (Ize's example if my memory is correct has a zip with a capx and php files)
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,786


Return to How do I....?

Who is online

Users browsing this forum: anty21ro, LeFuji, RookieDev, TRMG, Yahoo [Bot] and 19 guests