How do I post data with ajax

Get help using Construct 2

Post » Thu Aug 21, 2014 4:44 am

Hi,

I want to post data to a php using ajax. The php store the info to mysql database.

i have this:
Global text: ""
Global number: 0
Global email: ""
The globla variables are the text of the respective text field.
On button clicked - action - Ajax send "name=name&phone=phone&email=email" to localhost method "POST"

But when i look to my db i see this: name 0 email (the 0 is because the field is int)
How can i send variables through ajax?

Thanks.
B
5
S
1
Posts: 14
Reputation: 408

Post » Thu Aug 21, 2014 5:39 am

Open Firebug console (FF) or Developer Tool (chrome) by pressing F12
Then trigger the ajax call and see your ajax request in those console to inspect where the problem come from...
B
5
Posts: 1
Reputation: 229

Post » Thu Aug 21, 2014 9:53 am

"name=name&phone=phone&email=email"

Try:
Code: Select all
"name=" & name & "phone=" & phone & "email=" & email
B
55
S
29
G
19
Posts: 1,520
Reputation: 25,670

Post » Fri Aug 22, 2014 2:55 am

Tthanks ramones,

You help me so much! :)

the right answer: "name=" & name & "&phone=" & phone & "&email=" & email

You can close this.
B
5
S
1
Posts: 14
Reputation: 408


Return to How do I....?

Who is online

Users browsing this forum: moebios and 5 guests