I am new to jquery also to php so my question sound quite simple or silly. Any help would be appreciated. I have an html in where i add and delete rows via buttons. And I want to update database by these data by another button. So i need the get length of my table to insert them within a loop in php side. How can i tranfer data to php side? I tried something like that.. As javascript code
function Length()
{
var table=document.getElementById("Table");
var len = table.rows.length;
$.post('/myproject/update_data.php', { "CONTROL": "len" } );
}
on html;
<input type="submit" name="UPDATE" id="UPDATE" value="UPDATE" onclick="return Length();"/>
on php side it goes like
<?php
if(isset($_POST["UPDATE"]))
{
$length=$_REQUEST["CONTROL"];
}
?>
And i get CONTROL is not defined. Is it a syntax wrong that i type directory of php file? Or any thing else? I couldnt get. Thank you