To perform your query on the database based on the input and open the result in another window, do the following:
Your input must be within a <form>
tag that has a target="_blank"
attribute. Your page will look something like this:
<form action="novaTela.php" method="post" target="_blank">
<input type="text" name="txtPesquisa" id="txtPesquisa" />
<inut type="submit" name="btnEnviar" value="Enviar" />
</form>
In this example, we are sending the input to the newTel.php page. You should schedule the database call on this new page.
ARCHIVE newTele.php:
<?php
$txtPesquisa = $_POST['txtPesquisa'];
echo "FAZER A CONSULTA NO BANCO DE DADOS";
?>
For academic purposes: the target
attribute of the <form
tag allows us to assign the following values:
_self : If no value is entered, _self will be the default value. It sends the form to the same page as the form;
_blank : it sends the form to a new page (tell which page through the action
attribute;
_parent : sends the form to the page that called the new window;
_top : Sends the form to the page that called frame
;
framename : Sends the form to a specific frame
;