Calling a php file from a javascript file in wordpress

I have a simple pop up form code written in javascript. It is in js/script.js folder inside themes folder.

I am using jquery ajax method to communicate with a php file to store data in db.

Read More

The php file is in themes folder. Also i would like to use the wordpress functions in that php file.

The display of pop up and form works fine. But when i submit it, i get 404 error. I am confused as to how to tell wordpress to include this php file.

THanks


EDIT: I could make the jquery code work by giving the full URL to the php file. However, now i want to be able to use the wp functins in that php file.

Related posts

Leave a Reply

1 comment