Hi. Today I want to do a php page that render part of my html code. Let me explain with some code…
I have a first part of a HTML page (have head tags, css code and part of the body)
a second HTML page (have multiple content, I explain this later)
and a third HTML page (this one have the last tags (such as and similar)
The second HTML page derives from a PHP script. This script has multiple HTML codes that run when I call them with $_GET variable.
Example of the second page:
[php]<?php
//loads the first part of the HTML page
require_once(“partOne.html”);
switch ($_GET[“contentName”]) {
case “welcome”:
// reads the content with ID “welcome” [I don’t know how to to that]
break;
case “goodbye”:
// reads the content with ID “goodbye” [Same thing here!]
break;
}
//loads the third part of the HTML page
require_once(“endpage.html”);
?>
So I want to write on the address bar “page.php?contentName=welcome” and see all the page without the goodbye content and vice versa. But I don’t know how to do that. In some forums they said to use “HTML Parser”, could you give me sample codes to understand how to use that? Thanks.