1
How do I pass the data of a form (query.php) of a page to the textbox and a radiobutton of the form (register.php) of another page without the action ? Because I have two Ubmit buttons for that same form (query.php) and I would not like to use the action for the 2, I would just like to open the other page (register.php) with the textbox and radiobutton filled in by the form of the other page (query.php) with a Ubmit button, the other button of the.php query page I would like when triggered to remain on the same page (query.php).
The code of the.php query:
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>";
}
}