Ankit Rane Posted May 24, 2022 Share Posted May 24, 2022 Hello everyone, i am using the following code ajax code to insert in table but unable to get the result $.ajax({ url: 'subcriberList.php', data: {'email' : email,'name' : name}, type: 'post', success: function(success) { swal({ title: "Thank you for subscribing!", icon: "success", }); } }); Link to comment Share on other sites More sharing options...
Jan Romero Posted May 24, 2022 Share Posted May 24, 2022 Hi, welcome to the forums! Are you using ProcessWire for this? It looks like you’re submitting your data to a file called “subcriberList.php”. Can you elaborate on where this file is and what it does? Link to comment Share on other sites More sharing options...
Ankit Rane Posted May 24, 2022 Author Share Posted May 24, 2022 Hi, Yes i am using ProcessWire. Basically file called “subcriberList.php” contains an insert query like write in corePHP to insert a record in database table. And 'subcriberList.php' is present in the template folder. Link to comment Share on other sites More sharing options...
Jan Romero Posted May 24, 2022 Share Posted May 24, 2022 By default, ProcessWire will prevent you from running subcruberList.php like that (you will get error 404 or 403). What you can do is create a ProcessWire template and set subcriberList.php as its template file. Then create a page with that template and do your POST request to that page. There are a couple of threads in the forums about handling forms that may be of help. Also consider using a form module such as FormBuilder. 3 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now