NotSureILikePHP Posted August 5, 2015 Share Posted August 5, 2015 I have a dropdown menu that loads multiple locations for customers, i.e. Walmart has a location in Georgia and Louisiana. When I select the Georgia location data is filled using that location id like the phone, address, etc. The problem is that my company is using an open source software for their ticketing system and they have dramatically changed the way they do things on this new upgrade that I am trying to set up. Now when that onchange event is fired, causing a postback, it throws a CSRF Token Validation error. The guys that code that system aren't usually very helpful so I thought that maybe I could use ajax to avoid the postback and still populate the data. The data is pulled from the querystring on page load for the location ID and then that ID is used to call a function in a different php page. Is there a way I can call that function from ajax or do I need to copy that code to a separate blank php page? Quote Link to comment Share on other sites More sharing options...
scootstah Posted August 5, 2015 Share Posted August 5, 2015 Sounds like you just need to include the CSRF token in the request. Quote Link to comment Share on other sites More sharing options...
NotSureILikePHP Posted August 5, 2015 Author Share Posted August 5, 2015 How might I do that? I've never worked with these tokens before. Quote Link to comment Share on other sites More sharing options...
scootstah Posted August 5, 2015 Share Posted August 5, 2015 That is specific to the implementation in that piece of software. If there is no resources or technical support for the platform then you'll probably have to dig through and figure out how they are generating the token. Quote Link to comment Share on other sites More sharing options...
NotSureILikePHP Posted August 5, 2015 Author Share Posted August 5, 2015 Thanks I'll give that a shot Quote Link to comment Share on other sites More sharing options...
NotSureILikePHP Posted August 5, 2015 Author Share Posted August 5, 2015 I figured it out. I was adding the token in the form but there were multiple forms and I wasn't adding it into the correct form. Thanks for the help! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.