You need to write a web text editor that will send data from text forms to the server. As I understand it, it was possible to do this via XMLHttpRequest (each form is sent separately, the page is not reloaded). Theoretical code:
<!DOCTYPE HTML> <html> <head> <meta charset="utf-8"> </head> <body> <tr><td>Text1</td><td>Text2</td><td><textarea>Text3</textarea><button onclick = "send_data()" id="button">Отправить</button></tr> <script> function send_data() { button.innerHTML = ' ... '; s = button.previousElementSibling; var text = s.value; var http = new XMLHttpRequest(); var url = "get_data.php"; http.open("POST", url, true); http.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); http.onreadystatechange = function() { if(http.readyState == 4 && http.status == 200) { alert(http.responseText); } } http.send(text); } </script> </body> </html> How can I get the send_data function to identify the button that was pressed (to get the desired text) (id only 1) and how to write a php file that will receive the information and write it to the file?
send_data(this)- Grundy