<!doctype html>
<html lang="en">
<head>
<title>Tim's Language Helper</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<style>
    table.main, td.col_ctl, td.col_word, td.col_meaning {
        border: 1px solid red;
        border-collapse: collapse;
        padding:5px;
    }
    table.meaning, td.meaning {
        border: none;
        border-collapse: collapse;
    }
   
    p.debug {
        display: none;
    }

</style>
<script>
    
    // AJAX request to add a row for word test error
    function add_word_test_error() {
        user_id = document.getElementById("i_user_id").value
        meaning_id = document.getElementById("i_meaning_id").value
        wrong_word_id = document.getElementById("i_wrong_word_id").value
        const xhttp = new XMLHttpRequest();
        xhttp.onload = function() {
            //alert("this.responseText:=" + this.responseText)
            document.getElementById("result").innerHTML = this.responseText;
        }
        request = "add_word_test_error.php?user_id=" + user_id + "&meaning_id=" + meaning_id + "&wrong_word_id=" + wrong_word_id
        xhttp.open("GET", request, true);
        xhttp.send();
    }
    

</script>
</head>
<body>

<h1>Tim's Language Helper</h1>
<h2>Add Word Test Error</h2>

    <br/>User Id: <input type="text" id="i_user_id">
    <br/>Meaning Id: <input type="text" id="i_meaning_id">
    <br/>Wrong Word Id: <input type="text" id="i_wrong_word_id">
    <br/><button onclick="add_word_test_error()">Add Word Test Error</button>

<div id="result"></div>

<?php

?>

</body>
</html>