How to receive value by GET?

1

I'm trying to get a value to get in the url but I can not get someone to help me and show me my error:

<?php require_once("../database/conexao.php") ?>
<?php 

url = teste.com/teste.php?q=123456
if( isset($_POST) & !empty($_POST) ) {
   $cpf = $_GET["q"];
   $npass = $_POST["newpass1"]; 
   $newpass  = "UPDATE usuarios ";
   $newpass .= "SET ";
   $newpass .= "senha = '{$npass}' ";
   $newpass .= "WHERE cpf = '$cpf'";  
   $confirma =  mysqli_query($conecta,$newpass);

   if($confirma){
      echo $cpf;
      echo "senha alterada com sucesso";
   }else{
      echo "problemas ao alterar senha";
   }
}

?>

I put an echo in my variable $cpf and it does not appear anything

    
asked by anonymous 19.05.2018 / 07:27

0 answers