I added the missing quotes into post #7.
I added the missing quotes into post #7.
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
Well after initial testing and breif spot-checking for consistency across pages it seems to be working with the redirect line intact, thank you!
If it's not too much to ask, could you maybe try to help me understand more about what the problem was and why this solution fixed it? I'm learning more about Zen Cart, and its use of php, javascript, etc. every day but I really like to understand why something is happening, so that in the future I can implement and build on that knowledge.
If it's inappropriate to do here then can you private message me? If you are too busy that's okay – like I said I just much prefer to understand more about what's going on than to Copy & Paste a fix and call it a day.
Last edited by RobertH; 3 Feb 2016 at 03:47 PM. Reason: *just
I've thought of a possible issue and I don't know if it is already accounted for based on this setup of the XHR POST.
Right now, as you've seen, I'm working on a test site on localhost, but my live site has an SSL certificate and allows for https browsing. Will the current code be able to .load() "ajax_compare.php" while on https connection?
Zen Cart, like any responsible framework, protects against CSRF attacks by requiring POSTs to include a security token. When absent, it rejects the POST.
Your ajax .load() command is passing an object, which forces the ajax call to be a POST.
The change I suggested causes your ajax command to include the security token as part of the POST, so that it an be validated.
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.