I can not send variable to php

Discussion and feedback on Construct 2

Post » Sat Jun 30, 2012 2:45 am

Staff,
when I make a request via ajax, it works. But when I send variables, it does not work.
Can anyone help me?

Global number score = 10
Global text level = "a"

"http://mypage/index.php?&score=" & score & "&level=" & level
B
1
Posts: 1
Reputation: 227

Post » Sat Jun 30, 2012 11:40 am

The correct way to use query strings is:
index.php?score=a&level=b
not this:
index.php?&score=a&level=b
Apart from that, this is not the best place to ask questions about PHP - it would be better to find a programming forum, or ask on a site like StackOverflow.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Sat Jun 30, 2012 10:07 pm

also the string delimiter for javascript is + not &
B
10
S
5
G
1
Posts: 37
Reputation: 1,631

Post » Sat Jun 30, 2012 10:13 pm

@twdead - what do you mean? I believe the information I gave is correct, and I'm not sure what you're referring to.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Sat Jun 30, 2012 10:43 pm

@twdead
Of course Ashley is right. He's talking about query strings and you're talking about JavaScript strings - two entirely different types of strings.Velojet2012-06-30 22:44:04
B
105
S
20
G
12
Posts: 549
Reputation: 20,320

Post » Sun Jul 01, 2012 9:35 pm

my mistake, sorry.

I wasn't trying to correct Ashley, it looked like helenDarkAvenger was using the wrong type in the string they posted (trying to send the string with variables), which is what I was referring to.twdead2012-07-01 21:46:01
B
10
S
5
G
1
Posts: 37
Reputation: 1,631


Return to Construct 2 General

Who is online

Users browsing this forum: Silverforce, Unconnected, Zebbi and 13 guests