Hello everyone) What I have: Link:
<a href="" title="" onclick="document.dir.folder.value = '<? echo $value?>'; listdir();"><?php echo $value; ?></a> Js:
function listdir(){ xhttp = new XMLHttpRequest(); xhttp.open('POST', 'App.php', true); xhttp.send("folder="+document.getElementById('folder').value); xhttp.onreadystatechange = function() { if (xhttp.readyState != 4) { return; } if (xhttp.status == 200) { console.log(xhttp.responseText); }else{ console.log(xhttp.responseText); } } } When you click on a link, the folder field is hidden from the user and the js is transmitted. Everything is transmitted correctly. Further, via Ajax to the server, a banal check:
if(isset($_POST['folder'])): echo "Okay"; else: echo 'No'; endif; Data is not transferred to the server. What is the problem? In JS is not very strong)