GetSimple Support Forum
QUESTION Form handling via AJAX post(), best practice. - Printable Version

+- GetSimple Support Forum (http://get-simple.info/forums)
+-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3)
+--- Forum: General Questions and Problems (http://get-simple.info/forums/forumdisplay.php?fid=16)
+--- Thread: QUESTION Form handling via AJAX post(), best practice. (/showthread.php?tid=9956)



Form handling via AJAX post(), best practice. - roy_b8te - 2017-08-19

Hi there, I'm having problems with form submissions that are processed via AJAX post as I'm trying to keep complaint.

If I place the standard:
Code:
<?php if(!defined('IN_GS')){ die('you cannot load this page directly.'); }
at the top of my form script in the template folder, the request dies and returns the message ( as it should ).

If I convert the form script into a plugin, I can't call the script directly or pass serialized arrays after runtime.
I can get it to work w/o the defined() condition but that would be obviously not a good idea as the script's location is revealed in the client source.

Are my only options having the form handling script included in the page script? Or does AJAX not work well with GS?
Any opinions / answers welcome.
Thanks


RE: Form handling via AJAX post(), best practice. - shawn_a - 2017-08-20

Why not? Did you add the proper allow htaccess?