Jump to content
Server Maintenance This Week. ×

Redirect on wrong login issue


This topic is 3670 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Ive attached my code pages.

The issue i have is if the login credentials is correct it redirects great but of not then it doesn't work and displays an error of below. Whats goin wrong? I used some of the functions from a plugin that i own to play with and they work just not if its wrong login.

 

 

 

login.zip

Link to comment
Share on other sites

What error? You also have the call to error.php commented out in login.php

the error i get is Fatal error: Call to undefined method FileMaker_Error::getRecords() in /home/mjohnson/public_html/ergo/login.php on line 101.

 

Yea i have it commented out for now but if i re-enable fmpTrapError($result, "error.php"); function then i get the above if it try to login with the wrong credentials but if i login with correct credentials then it redirects to LoginSuccessfull.php like its suppose to.

Link to comment
Share on other sites

still having issues. I rearranged the getrecords() function to go below the Filemaker::iserror($result) and it doesnt give me the above error but the fmpTraperror or fmptraperror2 not the standard header redirect doesnt go to the error page like its suppose to. 

 

fmpTrapError is the standard error function that gives me filemaker's errors but i modified it with fmpTrapError2 to pass my own errors if i want to so if someone can look at that and make sure im doing it right that would be great.

error.php

login.php

Functions.php

defines.php

Link to comment
Share on other sites

ok i got it to redirect finally. it was an error on my error.php page with session start etc on top with a redirect back to login which was working correctly.

 

My only issues now is, and i've uploaded the updated pages, is on line 24 or so, theres an fmpTrapError2 function that im passing my own message into along with the error code that doesnt seem to work properly on the error page. Not sure if im doing it right or not in the function.

Functions.php

error.php

login.php

Link to comment
Share on other sites

One more question, how to i write that fmpTrapError2 function to not only go to an error page but also give me a url in a variable that i can echo out to that go back to previous page button so they can click the button and go back if i wanted them to? obviously i have the navigation so they can click whatever but id like to have it just in case.

Link to comment
Share on other sites

This topic is 3670 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.