I cannot declare variable inside id

Asked

Viewed 28 times

0

@$c_id = $_POST['numero'];
@$data_aa = $_POST['data_aa']; // Data esta vazio

if($data_aa == ''){
$var = "oi";
echo "$var";
}

If I put the variable $var outside the if(), works normally.

  • How is your html?

  • Friend I just got, thanks for the help and attention!!

1 answer

0

I managed by making != empty (null)

if ($data_aa != null) {
    // funcionou!!!
}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.