I have been building a site using php and would like advice to improve the structure of my site and the best way to lay out my code for SEO. I'm also a little concerned about echoing large chunks of HTML and how SEO will work with my structure.
Ok here's my structure...
My site contains many pages with only the body content changing for each page. So I have created template functions in PHP for echoing HTML. I use $_GET['page_id'] in a switch statement to determine what page content to load. .
my pages look something like this....
Header(); //echo header HTML
switch ($_GET['page_id']) //Echo body content
{
default: homePage(); break;
case 1: servicesPage(); break;
case 2: galleryPage(); break;
case 3: contactPage(); break;
}
Footer(); //Echo footer HTML
And my php functions look like this
function header() {
echo "<div>
<h1>Header</h1>
</div>";
}
function footer() {
echo "<div>
<h1>Header</h1>
</div>";
}
function homePage()
{
echo "<div>
<h1> Home </h1>
<ul>
<li> Home1 </li>
<li> Home1 </li>
</ul>
<p>This is home page</p>
</div>";
}
I'm really looking for any pointers to improve my code but my main concerns are...
Is it ok to echo large chucks of HTML like that from php? especially with my site growing?
Does Google crawler bot still crawl my site ok using $_GET['page_id'] for all my pages?
P.S I'm new here, so sorry if any code formatting is a little off!