Absolute Path (ABSPATH) in WordPress is not working

insert.php file that I made myself, actually I am new to wordpress,
I want to that is there any mistake that i am making? Actually I want
to store a plugin form information in the database.

Your question is very light on detail but I suspect that the mistake you are making is loading a file in such a way as it loads outside the context of WordPress, or in such a way that only parts of WordPress get loaded.

The lack of detail in your question– the near complete lack of context for the code– makes it impossible to provide a solid answer but I am leaning toward suggesting that you need to run your code via the AJAX API (even if not strictly AJAX). Something like this: https://wordpress.stackexchange.com/a/108145/21376

If you want a better answer, you must write a better question. Please click the “edit” button under your question and add as much detail as you can, but keep it organized.

Leave a Comment