Hi, I'm doing a web page in php but I'm using a template that includes it to the php and the page I modify it in php only that sometimes I need to resort to html, for that I show the content from the template. I do not know if it is the best way to make a web page I do not have much experience in PHP. Well, what I'm trying to do is that the echo be shown in content but I did not get anything new. Code:
Php code where I design the different page to the template:
<?php
require_once 'database.php';
$database_connection = database_connect();
$title='hola';
$content='<div>';
//user input
$page = isset($_GET['page']) ? (int)$_GET['page'] : 1;
*** Lo muestra fuera del template ****
echo $perPage = isset($_GET['per-page']) && $_GET['per-page'] <= 50 ? (int)$_GET['per-page'] : 5;
$content .= '</div>';
include 'Template.php';
?>
Template php code:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><?php echo $title; ?></title>
<link rel="stylesheet" type="text/css" href="Styles/Stylesheet.css" />
</head>
<body>
<div id="wrapper">
<div id="banner">
</div>
<nav id="navigation">
<ul id="nav">
<li><a href="index.php">Home</a></li>
<li><a href="tool.php">Coffee</a></li>
<li><a href="manager.php">Shop</a></li>
<li><a href="#">About</a></li>
</ul>
</nav>
<div id="content_area">
<?php echo $content; ?>
</div>
<div id="sidebar">
</div>
<footer>
<p>All rights reserved</p>
</footer>
</div>
</body>
</html>
Any suggestions are welcome. Thanks for your help.