For example i have a variable
var test = "done";
how can I send it to php? and then post it
For example i have a variable
var test = "done";
how can I send it to php? and then post it
try with this code
<script>
var test = "done";
document.getElementById('sample').value = test;
</script>
<form method = "post">
<input type="hidden" id="sample" name="stext">
<input type="submit" name="submit" value="submit">
</form>
<?php
echo $_POST['stext'];
?>