How to launch PHP script using JS?
9/11/2018 9:09:14 AMJan Štěch
4 AnswersNew Answer
Ok, after a lot of googling I managed to solve it myself. I am writing this answer here in case somebody with the same problem finds this questuon. The solution is AJAX (asynchronus java script something). I simply pass name of the file with the PHP script to a HTTP request and I pass the argument via cookie. In JS I use document.cookie = "value = " + variable; and in PHP I use $_COOKIE['value']; to get the variable. Removing the row from DOM is also improved now. Instead of calculating row's id using viewport height and y-coordinate of the mouse click, I use event.target.parentNode.parentNode to get the tr element.
Please,I realy need to know this. At least send me a link to some online tutorial about it or simply some thread on different platform with similar question.