I form: inviare informazioni con il metodo POST
<!DOCTYPE html>
<html>
<head>
<script>
function formSubmit(formId,destination)
{
document.getElementById(formId).target = "iframe_receive";
//in questo caso è il riferimento all'inner frame
//normalmente il target sarà _self o _blank
document.getElementById(formId).action = destination;
document.getElementById(formId).submit();
}
</script>
</head>
<body>
<form id="formId" enctype="multipart/form-data" method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>" target="_self">
<input type="text" name="myField" value="">
<input type="button" id="submitBtn" value="INVIA">
</form>
<script>
function fnct_formSubmit()
{
formSubmit('formId','_php_formReceive.php');
//inserire il nome del file php di destinazione
}
document.getElementById("submitBtn").addEventListener("click", fnct_formSubmit);
</script>
</body>
</html>
<?php
$myField=$_POST["myField"];
?>
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div>Contenuto del campo "myField": <?php echo $myField;?></div>
</body>
</html>