By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,256 Members | 1,663 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,256 IT Pros & Developers. It's quick & easy.

Evaluate login result and do something...

P: 38
Hello again Bytes and TGIF!

I've got an index page (text version) that has a login form with data being sent to a file called pwcheck.php (txt version)

With a good login the success message is being displayed correctly but I need to then reload the index page.

However I do not need to reload index if the login fails, instead report the failure and simply clear the form fields for another try.

How does one evaluate the response from pwcheck.php and act differently based on the html data returned?

Please excuse my code, I'm sure it's sub-par, but I'm java-rookie-supreme with tons more questions than answers.

Sep 11 '09 #1
Share this Question
Share on Google+
3 Replies

Expert Mod 15k+
P: 16,027
If you're going to reload the page on success, why not do away with Ajax?

To evaluate the result, get the responseText and check its content. You can code your server-side code to return a particular response for failure which you can check for.
Sep 12 '09 #2

P: 38
Let me move the htaccess file out of the way again so it's visible.

I prefer to keep it as seamless as possible acoder.

Ultimately I'd like to login, evaluate for success and if good, load/show the large data table (#entrytext) table under the (#onshdr)

I guess by using the post method I'm not going to achieve that?
Is that also is contributing to the loading image being useless right now?

user credentials: tmp:tmp

Sep 12 '09 #3

Expert Mod 15k+
P: 16,027
Since you're using jQuery, check out the documentation on Ajax.
Sep 14 '09 #4

Post your reply

Sign in to post your reply or Sign up for a free account.