Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how insert some parts html inner php?

12 views
Skip to first unread message

albert

unread,
May 16, 2017, 4:22:52 PM5/16/17
to
I have a basic page: file_0,
and other pages with html text.
this pages must to be insert inner at the file_0, but not a simple
inclusion, is necessary insert in the parts


https://postimg.org/image/maqsvjsen/

the final page is a page with a menu
example with 2 items
when click on link1 insert the file's 1 parts
when click on link2 insert the file's 2 parts

Jerry Stuckle

unread,
May 17, 2017, 10:22:21 AM5/17/17
to
You can't do this just with include(_once) or require(_once). Both will
simply copy the complete file into the current one at the point of the
statement.

You have two easy ways to do this. You can split each file into
multiple parts, i.e. file_1a, file_1b, etc., and include the appropriate
files at the appropriate places. The other is to create the html files
as php files, and have functions to print the appropriate sections, i.e.

<?php
function part_a() {
?>
html for part a goes here
<?php
}
?>

Include the file at the beginning and call the functions where required.

--
==================
Remove the "x" from my email address
Jerry Stuckle
jstu...@attglobal.net
==================
0 new messages