skip to Main Content

I am passing javascript variable to php using fetch api method post but in php file i am getting error: undefined array key 'data'. How to fix it?

------html code------ <html> <body> <textarea id="my-textarea"> </textarea> <button onclick="_post_text_area_()" id="submit-btn">Submit</button> </body> <html> ------javascript code------ # get value of textarea var textarea = document.getElementById("my-textarea"); function _post_text_area_() { var data = textarea.value; # show textarea value to console console.log(data); # pass data…

VIEW QUESTION
Back To Top
Search