I'm trying to get through <?php include ''.$prod_04.'php'; ?>
but I'm not having return content registered in $_SESSION['hab_prod_04']
.
Already check using <?php echo $prod_04 ?>
, and it is being written to $_SESSION['hab_prod_04']
the changes you want.
I'm using the following code to make the change:
<?php
$botao=$_POST['enter'];
if($botao=="Cadastrar"){
$prod_04 = $_POST["prod_04"];
if(!empty($prod_04)) {
$_SESSION['hab_prod_04']["prod_04"] = $prod_04 ;
echo "<meta http-equiv='refresh' content='0; URL= prod_cad_produtos_5_img.php'>
<script language='javascript'>
window.alert('Produto Cadastrado com sucesso!');
</script>";
}}
?>
<form method="post">
<input type="hidden" name="prod_04" value="produto_04">
<input type="reset" value="Limpar">
<input type="submit" value="Cadastrar" name="enter"/>
</form>
Below code for $_SESSION['hab_prod_04']
:
if(!isset($_SESSION['hab_prod_04'])){
$prod_04 = 'Vazio'; // Carrega esse conteúdo
$_SESSION['hab_prod_04']['prod_04']=$prod_04;
}else if(isset($_SESSION['hab_prod_04'])){
$prod_04 = $_SESSION['hab_prod_04']["prod_04"];
}
If friends can help me understand where I'm going wrong, so that I can not see content with <?php include ''.$prod_04.'php'; ?>
, and <?php echo $prod_04 ?>
I can.
PS: When I use <?php include 'produto_04.php'; ?>
, it works.
I thank you all for the attention given to my problem.