Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #17445 > unrolled thread
| Started by | albert <alstopspam@stopaspam.com> |
|---|---|
| First post | 2017-05-16 22:22 +0200 |
| Last post | 2017-05-17 10:22 -0400 |
| Articles | 2 — 2 participants |
Back to article view | Back to comp.lang.php
how insert some parts html inner php? albert <alstopspam@stopaspam.com> - 2017-05-16 22:22 +0200
Re: how insert some parts html inner php? Jerry Stuckle <jstucklex@attglobal.net> - 2017-05-17 10:22 -0400
| From | albert <alstopspam@stopaspam.com> |
|---|---|
| Date | 2017-05-16 22:22 +0200 |
| Subject | how insert some parts html inner php? |
| Message-ID | <offn2m$1lh0$1@gioia.aioe.org> |
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
[toc] | [next] | [standalone]
| From | Jerry Stuckle <jstucklex@attglobal.net> |
|---|---|
| Date | 2017-05-17 10:22 -0400 |
| Message-ID | <ofhm47$oo2$1@jstuckle.eternal-september.org> |
| In reply to | #17445 |
On 5/16/2017 4:22 PM, albert wrote:
> 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
>
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
jstucklex@attglobal.net
==================
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.php
csiph-web