PDA

View Full Version : HOW to use PHP include


fourty711
10-28-2012, 04:47 AM
Hi! I need to place several webpages by clicking link buttons into the same DIV container on my HOME page and keep the home page visible all the time. I have looked up several ( include ) codes in php and also in Jquery but no one places webpages into the site they only show changing colours or letter formats etc.
Please if you have a way to get the above information completed for my website it would help to fiinsh off what I am trying to do.
Thanks for any help.:sad:
Here is my email: fourty711@hotmail.co.uk

domedia
10-29-2012, 01:54 PM
Hi Fourty, that's not how it works. You don't place web pages inside web pages.
Do you have a wireframe or a design mockup?

jmichae3
11-12-2012, 07:47 AM
he's right. let me explain what he is saying. HTML has a specific near-boilerpolate top which looks basically like

<!DOCTYPE html>
<html lang="en-us">
<head>
<title>some title here</title>
head tags here
</head>
<body>
body content here
</body>
</html>
between <body></body> is where you insert your content tags. what is NOT allowed in head is tags like html and what is not allowed in body is tags like html, body, head, title, meta, base, link. it's for this reason you should look at the standards document
whatwg multipage HTML5 Standard (http://www.whatwg.org/specs/web-apps/current-work/multipage/)
or a decently-written HTML book which tells you this kind of stuff to see what elements are allowed inside what other elements (shown as categorized "Content:" in the standard. there are lists of those things. I also have a summary document at http://Jesusnjim.com/common/html5-tags.txt which is regex-searchable.
a very helpful (but old) book is the "Hip Pocket Guide to HTML 4.0/4.01/3.2" (pick one, it's available at a bookstore used near you or amazon.com). this will get you started in the right direction.

the usual way to include webpages within web pages is using an iframe or frame, and those are not search-engine friendly. but there are other ways using PHP.

jmichae3
11-12-2012, 07:52 AM
just put the header and footer in PHP and switch out content files using file_get_contents() and echo.