2
I would like to have my function go through all the files within the system. What they have in common is the header.php
. I would like the header function to be available in all files that enter below it.
header.php
----------
function urlbase(){
$url = "meusite.com.br";
}
Corpo com include header e footer
---------------------------------
contato.php | usuarios.php | fornecedores.php | noticias.php
footer.php
Question: How to make the function available in all body files?
It’s not just putting the function inside the
header.php
? Since theheader.php
goes on all pages, the function goes along. I’m not sure I understand what you need.– Diego Souza
Create the function inside a php file and then include that same file inside the other pages, using include or require.
– Alisson
@That’s what Taopaipai is, but I can’t seem to do it :)
– Marcos Vinicius
But gives some error ? Or does not work its function ?
– Diego Souza
Guys, thanks for your help. There’s a time when it gets really crazy :)
– Marcos Vinicius