I am trying to fetch some information from database in wordpress. I used jquery for sending ajax request and fetch the data from php file named values.php . My php code is below
But after sending ajax request the php file sends me nothing. For testing I have added "echo 'test';" , but it does not display. When I remove or write the code "echo 'test'" at top of this code "require_once($path.'/wp-config.php');" then it works, I mean "echo 'test';" shows. That means the problem is in require_once.
I have tried many ways for solve this problem, but nothing works.
Please give me suggestion what should I do now.