Good afternoon, I'm new here, I'm starting in php, html, css, I'm making my website, and I came across a first problem, I'm making it dynamic but without using a database for now, but I load the pages through:
<?php
function escolhe_pagina() {
(isset($_GET['p'])) ? $pagina = $_GET['p'] : $pagina = 'home';
if(file_exists($pagina.'.php')):
require_once($pagina.'.php');
else:
require_once('home.php');
endif;
}
?>
My index.php looked like this:
<?php
require_once('funcao_escolhe_pagina.php'); // Function to Select the Clicked Page Dynamically
require_once('funcao_escolhe_titulo.php'); // Function to Select the Title according to the Accessed Page
require_once('funcao_escolhe_estilo.php'); // Function to Select the Style according to the Accessed Page
//
require_once('header.php'); // HTML data
require_once('navbar.php'); // Menu Data
escolhe_pagina(); //require_once('home.php'); // Body Data - Home or Other Pages
require_once('footer.php'); // Page footer data
?>
That is, it has the standard header, navbar and footer pages fixed using require_once, and chooses the page that can be home, contact, newsletter, etc.
It is calling the pages correctly, but when I enter the contact or newsletter page it enters, but after filling out the form and it does not call the envio_email_contato.php page in the action and if I put a link instead of input button there it sends the e-mail but the contact data is sent blank, without filling, I don't know how to solve it if anyone can help me, thank you in advance.
Roberto S. Dias