4D SIA: Inviare i dati da un modulo form a due pagine Php contemporaneamente
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghyphenhyphen-wqFNbrjXB_fcp-GQF-2BRDdDdJkZ6xIPewwnhtv__zvh75_GE8ovOR9v_H_1xAfYr6O5m60ZV03kOSc5gabjMoYdZqeB2S9TfT4DsLgzCAQfTt8DMGizEzwh9uZKKKO8ot5GvGiEU/s320/php-html.jpg)
Per inviare i dati di un modulo form a più pagine Php contemporaneamente bisogna usare una funzione in Javascript.
Ecco lo script che va personalizzato ovviamente in base ai propri campi:
<script>
function OnButton1()
{
document.form1.action = "pagina2.php"
document.form1.target = "_blank";
document.form1.submit();
document.form1.action = "pagina1.php"
document.form1.target = "_self";
document.form1.submit();
return true
}
</script>
<form name="form1" method="post">
<input type=text name="campo1" value="...">
<input type=text name="campo1" value="...">
<input type=text name="campo1" value="...">
<input type="submit" onclick="OnButton1();" >
</form>
Commenti
Posta un commento