0
Hello
I need to add one include
within a function if
but at run time does not read the added include. Someone can give me a hint where is the error.
Menu content.html
<div id='menutopo'>
<div id= 'menu1'>
<button id='dropbtn1'>Cadastro</button>
<div id='dropdown-content1'>
<a href='cadastrocliente.html'>Clientes</a>
<a href='cadastroprodutos.php'>Produtos</a>
</div>
</div>
<div id='menu2'>
<button id='dropbtn2'>Moveis</button>
<div id='dropdown-content2'>
<a href='fichademoveis.html'>Criar Ficha</a>
<a href='#'>Consulta de Ficha</a>
</div>
</div>
<div id= 'menu3'>
<button id='dropbtn3'>Consulta</button>
<div id='dropdown-content3'>
<a href='consultadecliente.php'>Clientes</a>
</div>
</div>
</div>
php file that checks and confirms the variareis will run an html.
<?php
include "in/conecta.inc";
?>
<?php
if($cont==1 && $cont2=1){
echo "<!DOCTYPE html>
<html lang='pt-br'>
<head>
<meta charset='UTF-8'/>
<meta name='description' content='Bem vindo ao Bsis vendas'>
<meta name='viewport' content='width=device-width, user-scalable=no, initial-scale=1.0,maximum-scale=1, minimun-scale=1'>
<link rel='icon' type='image/png' href='imagens/favicon.png'>
<link rel='stylesheet' type='text/css' href='css/estilo.css'>
<link rel='stylesheet' type='text/css' href='css/login.css'>
</head>
<body>
<header>
<?php
include ('in/menu.inc');?>
</header>
<div id='bordacabecalho'></div>
<footer>
<nav id='menurodape'>
<ul>
<li><a href='manual.html'>Manual</a></li>
</ul>
</nav>
</footer>
</body>
</html>";
}
else{
echo "<!DOCTYPE html>
<html lang='pt-br'>
<head>
<meta charset='UTF-8'/>
<meta name='description' content='Bem vindo ao Bsis vendas'>
<meta name='viewport' content='width=device-width, user-scalable=no, init ial-scale=1.0,maximum-scale=1, minimun-scale=1'>
<link rel='icon' type='image/png' href='imagens/favicon.png'>
<link rel='stylesheet' type='text/css' href='css/estilo.css'>
<link rel='stylesheet' type='text/css' href='css/login.css'>
<script src='javascript/login.js'>
</script>
</head>
<body>
<header>
<a href='index.html'><img id= 'logo' src='imagens/baixinhologo.png'></a>
</header>
<div id='bordacabecalho'></div>
<form id='login' action= 'login.php' method='post'>
<p>Login:<input type='text' name='login' placeholder= 'login'/></p>
<p>Senha:<input type='password' name='senha' placeholder='senha'/></p>
Senha incorreta tente novamente
<input type='submit'id='botao' name='botaoo' value='Entrar'/>
</form>
<footer>
<nav id='menurodape'>
<ul>
<li><a href='manual.html'>Manual</a></li>
</ul>
</nav>
</footer>
</body>
</html>";}
?>
Hi the items you mentioned were made, but they didn’t appear in these lines, unfortunately my problem continues and I don’t know what I’m doing wrong yet
– Danilo Araujo
You can post the entire code?
– StillBuggin
edited the full code
– Danilo Araujo
Try this last code. By the way, what extension is this
.inc
?– StillBuggin
Serious young man does not know the extent
.inc
. This extension more suitable for use of include. Your second code does not make sense because it opens<?php
and doesn’t close with ? >. Thanks for the help.– Danilo Araujo
You are completely wrong. Use all extensions with
.php
. I know that.inc
is a convention, but not all servers are configured to pass this extension as PHP codes. Another thing, In PHP files it is not necessary to close the tags. Feel free to read the best practice conventions in PHP programming: http://www.php-fig.org/. Spoke, young man!– StillBuggin
Thank you so much for the instructions, I agree that I may be wrong I will study more to try to understand better. Greetings for the concern in teaching.
– Danilo Araujo