0
I’m trying to bring through the <?php include ''.$prod_04.'php'; ?>
but I’m not getting back the content registered in $_SESSION['hab_prod_04']
.
Already check using <?php echo $prod_04 ?>
, and is being recorded in $_SESSION['hab_prod_04']
the desired changes.
I am 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 of $_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 I can’t see the content with the <?php include ''.$prod_04.'php'; ?>
, and with the <?php echo $prod_04 ?>
I can get.
PS.: When I use <?php include 'produto_04.php'; ?>
, works.
Thanks in advance to everyone for the attention given to my problem.
I have the impression that the problem is not even in Session. There is a point missing before
php'
? Exchange theinclude
forrequire
I can already tell.– Bacco
According to the edition it became clearer that it is a missing point before
php'
no include.– Bacco
Thanks @Bacco, that was the lack of the point between concatenate and php. Dude I’m two days trying to solve this my Pipino... Rsrsrs... Pure lack of attention on my part... As they say,"Who is out of the problem, sees better the solution". Again, FIGHT.
– Murilo Cabral