Page 1 of 2

MySQL Login Using PHP Script for a Wordpress Site (Script located on same server as database--not Appery.io)

Posted: Wed Aug 14, 2013 11:29 pm
by Jeff Givens

I have an app that I’m working on that I’m having user login issues. I broke out into a smaller app just for testing/debugging purposes. The issue I’m having is this: I am using a PHP script to pull user/login information from a MySQL database being used with a WordPress website to establish a connection. I’ve replaced the “print_r($user)” with a simple “true” state as seen below in the service test. Unfortunately, when I test the app, regardless of whether or not my login credentials are correct, I cannot seem to get a “success” return to invoke my ‘Navigate to Page’ event. I’ve tested this PHP script on hurl.it and verified a successful login return value. Also, as seen in the “Test” section for the service, you can see the Response is ‘true’ as well.
So my question is this: “What is the condition that must be met for the Success event to occur when using a service?” Simply that it is not an error?

Here is a link to a word document that has some screenshots of what I described above:
https://app.box.com/s/snq0nvor5kdctgp...

Also, I have already read the following page on handling REST Services, so please do not refer me to that page as the answer:
http://docs.appery.io/documentation/u...


MySQL Login Using PHP Script for a Wordpress Site (Script located on same server as database--not Appery.io)

Posted: Wed Aug 14, 2013 11:38 pm
by maxkatz

Check the console for errors: http://docs.appery.io/getting-help/. You might need to use the proxy: http://docs.appery.io/documentation/c...


MySQL Login Using PHP Script for a Wordpress Site (Script located on same server as database--not Appery.io)

Posted: Wed Aug 14, 2013 11:43 pm
by Jeff Givens

I am currently using the proxy. I will look into the console to see what I find. Will update soon as I figure something out. Thanks for expedient response.


MySQL Login Using PHP Script for a Wordpress Site (Script located on same server as database--not Appery.io)

Posted: Thu Aug 15, 2013 12:12 am
by Jeff Givens

So I tested using the console. Without a doubt, any 'failure' events on Errors are working perfectly :-) The problem is...even a valid login is getting me an error, apparently. Here are the results from my Console debugging:

http://snag.gy/kcP8G.jpg

The "Status Text 200 OK" line is where I entered the correct login information. The others were all incorrect login info.


MySQL Login Using PHP Script for a Wordpress Site (Script located on same server as database--not Appery.io)

Posted: Thu Aug 15, 2013 12:18 am
by maxkatz

What does your service return (what kind of data)?


MySQL Login Using PHP Script for a Wordpress Site (Script located on same server as database--not Appery.io)

Posted: Thu Aug 15, 2013 12:21 am
by Jeff Givens

Method: post
Data Type: xml
Settings: none
Security Content: none
Content Type: x-www-form-urlencoded
Use Proxy: (checked)


MySQL Login Using PHP Script for a Wordpress Site (Script located on same server as database--not Appery.io)

Posted: Thu Aug 15, 2013 12:23 am
by maxkatz

I meant the actual data from the service if the login is successful.


MySQL Login Using PHP Script for a Wordpress Site (Script located on same server as database--not Appery.io)

Posted: Thu Aug 15, 2013 12:25 am
by Jeff Givens

I can also change it to "Data type: json" and get the same result.


MySQL Login Using PHP Script for a Wordpress Site (Script located on same server as database--not Appery.io)

Posted: Thu Aug 15, 2013 12:29 am
by Jeff Givens

It's weird because I can reference the Response which is listed as:
"$" (an array) with a sub-parameter "success".

I can map that "success" index to a Label on the screen. When I use 'correct' login credentials, it will change the Label text to "true" and if I put in bad credentials, it changes the label to "false"


MySQL Login Using PHP Script for a Wordpress Site (Script located on same server as database--not Appery.io)

Posted: Thu Aug 15, 2013 12:30 am
by maxkatz

I'm looking to see the actual response from your service. Can you post a screen shot from Test tab?