How do I pass data from a form (query.php) of a page to the textbox and a radioButton of the form (cadastro.php) from another page without the action? Because I have two submit buttons for this same form (query.php) and would not like to use the action for the 2, I would just like to open the other page (cadastro.php) with the textbox and radiobutton filled out by the form on the other page ( query.php) with a submit button, the other button on the query.php page I would like when triggered to remain on the same page (query.php).
The query code.php:
if(isset($_POST['excluir'])){
foreach($_POST['selecionado'] as $cpf){
$sql = "DELETE FROM tbl_usuario WHERE cpf = '$cpf'";
$result = mysqli_query($strcon,$sql) or die("<script type='text/javascript'>alert('Erro ao tentar deletar usuário');</script>");
}
}
else if(isset($_POST['alterarConsulta'])){
foreach ($_POST['selecionado'] as $cpf){
$linhas[] = 1;
}
if(count($linhas) == 1){
$sql = "SELECT * FROM tbl_usuario WHERE cpf = '$cpf'";
$result = mysqli_query($strcon,$sql) or die("<script type='text/javascript'>alert('Erro no acesso aos dados');</script>");
$dados = mysqli_fetch_array($result);
$altcpf = $dados['cpf'];
$altnome = $dados['nome'];
$altsexo = $dados['sexo'];
$altidade = $dados['idade'];
$altcidade = $dados['cidade'];
$alttelefone = $dados['telefone'];
$altemail = $dados['email'];
header("Location: cadastro.php");
}
else{
echo "<script type='text/javascript'>alert('Selecione uma linha');</script>";
}
}