The code below is working fine, but it shows the result on his submit.php page.
<?php
// submit.php
echo $CODNOME;
if($_POST['CODNOME'] == "001"){
$msg = "mensagem1";
}
else if($_POST['CODNOME'] == "002"){
$msg = "mensagem2";
}
else {
$msg = "opção fixa";
}
echo $msg;
?>
What I would like and have it perform the function in submit.php and then come back with the result to print.php in the div print
<!-- imprimir.php !-->
<form method="post" id="CODNOME" action="submit.php">
<nav class="zz z_meio2 borda ">
insira o codigo
<br>
<input type="text" name="CODNOME" id="CODNOME"><br>
<button type="submit" >Enviar</button>
</nav>
</form>
<div class="print" STYLE="width:660px;">
<?php echo $msg;?>
<p>*conteúdo html e php</p>
</div>
Then how to create a javascripit to grab the data entered by the user in print.php send to submit.php and bring with the result in div print?