AJAX Post Problem

Get help using Construct 2

Post » Thu Sep 13, 2012 9:07 pm

Try the php I had posted earlier and just change the variables around to meet your needs. I know it works because I use it on my server with construct2. If it works you'll have a good starting point that just needs the security stuff put in.
www.h1k3.tech

We are here for you!
B
78
S
22
G
15
Posts: 709
Reputation: 16,010

Post » Thu Sep 13, 2012 9:13 pm

You can find an example of my working Ajax construct2 at the following link.
http://www.scirra.com/forum/what-am-i-doing-wrong-here_topic56751.html?KW=

Between the php example and the capx in the above link I'm hoping you can get yourself up and running. :)
www.h1k3.tech

We are here for you!
B
78
S
22
G
15
Posts: 709
Reputation: 16,010

Post » Thu Sep 13, 2012 9:14 pm

Ps @ashley

I can't find documentation on the data field in Ajax requests. How does it work?
www.h1k3.tech

We are here for you!
B
78
S
22
G
15
Posts: 709
Reputation: 16,010

Post » Thu Sep 13, 2012 9:38 pm

I think I know what's wrong. On the event sheet I have Button->On Clicked.
Instead I need to add the mouse plugin and have Mouse->left click on Button.

I've been clicking on the dang button expecting it to run the AJAX request but never added the mouse control to do so.

B
22
S
9
G
3
Posts: 203
Reputation: 3,653

Post » Thu Sep 13, 2012 9:47 pm

Disregard...that didn't work either. Having a look at your capx now.
B
22
S
9
G
3
Posts: 203
Reputation: 3,653


Post » Thu Sep 13, 2012 10:17 pm

That still seems like an awful lot of php for just updating one variable but I'm kind of new to it as well. Try posting the code On stackoverflow.com. They are usually very helpful as long as you are polite. Which I don't see a problem there for you. :)
www.h1k3.tech

We are here for you!
B
78
S
22
G
15
Posts: 709
Reputation: 16,010

Post » Fri Sep 14, 2012 12:07 am

A couple of things:
Put "http://localhost/..." or else it will think it's a relative URL.
And the tags in the 'on progress', 'on completed' and 'on error' actions should all match the request tag ("Post Score").
B
55
S
28
G
19
Posts: 1,520
Reputation: 25,540

Post » Sat Sep 15, 2012 8:35 am

I think I have an idea of the root issue...the AJAX post, when it submits the data to the php page, does not maintain the session.

Ashley, is that possible?
B
22
S
9
G
3
Posts: 203
Reputation: 3,653

Post » Sat Sep 15, 2012 4:46 pm

Here are all the files:
https://www.dropbox.com/sh/w34mew65rymweg5/UyHw8LXmXI
B
22
S
9
G
3
Posts: 203
Reputation: 3,653

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: Carlafnt, dokthor, Forioga, jhendy, the_Shit_hawk and 8 guests