Reply
Inserting other pages into body of main page
Old 05-31-2008, 02:47 PM Re: Inserting other pages into body of main page
wayfarer07's Avatar
$frontend->developer

Posts: 858
Name: Abel Mohler
Location: Asheville, North Carolina USA
When using SSI, you just put the code that you want displayed as a part of the included file. No keywords, doctype, etc, unless you are sharing that type of information throughout the site (which I often do). All include files are is snippets of HTML and/or other code. When it is parsed by the browser it thinks it is all one file.
__________________
wayfarer07 is offline
Reply With Quote
View Public Profile
 
Old 05-31-2008, 02:51 PM Re: Inserting other pages into body of main page
Arenlor's Avatar
Ultra Talker

Posts: 463
Name: Jerod Lycett
Location: /home/arenlor
It's server-side... it's parsed by the server and served as a single file.
__________________
PHP Code:
<?php echo "Hello World"?>
HTML Code:
<html><head><title>Hello World</title></head><body><p>Hello World</p></body></html>
Arenlor is offline
Reply With Quote
View Public Profile Visit Arenlor's homepage!
 
Old 05-31-2008, 02:55 PM Re: Inserting other pages into body of main page
Capt Quirk's Avatar
Extreme Talker

Posts: 202
Location: Flordidian
Quote:
Originally Posted by Arenlor View Post
It's server-side... it's parsed by the server and served as a single file.
ok, that makes sense then. All php parts are read as if it were one page, and not at all as individuals.

What are the cons of going completely php, if any?
__________________
http://GuitarGarage.tv , up and limping along.
Capt Quirk is offline
Reply With Quote
View Public Profile
 
Old 05-31-2008, 03:04 PM Re: Inserting other pages into body of main page
chrishirst's Avatar
Super Moderator

Posts: 12,767
Location: Blackpool. UK
Quote:
What are the cons of going completely php, if any?
You may have to learn to write code?
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 05-31-2008, 03:09 PM Re: Inserting other pages into body of main page
Capt Quirk's Avatar
Extreme Talker

Posts: 202
Location: Flordidian
That part is catching on, but there are new rules in play here and I am just trying to work within them.
__________________
http://GuitarGarage.tv , up and limping along.
Capt Quirk is offline
Reply With Quote
View Public Profile
 
Old 05-31-2008, 03:25 PM Re: Inserting other pages into body of main page
wayfarer07's Avatar
$frontend->developer

Posts: 858
Name: Abel Mohler
Location: Asheville, North Carolina USA
It helps to have previous programming experience, but anyone with critical thinking skills and a desire to learn can grasp PHP.
__________________
wayfarer07 is offline
Reply With Quote
View Public Profile
 
Old 05-31-2008, 03:27 PM Re: Inserting other pages into body of main page
chrishirst's Avatar
Super Moderator

Posts: 12,767
Location: Blackpool. UK
No new rules. You don't have to use PHP code on .php pages. The could be entirely HTML/CSS/javascript just like .htm(l) pages are.

all you do is construct your page in little bits and let the server put it all together.

so you have a bunch of common pages;

/include/dtd.php Just the doctype in this page
/include/htmltop.php Just has <html> and <head>
/include/charset.php Just the character set
... other common elements
/include/styles.php stylesheet definition
/include/closehead.php (</head> & <body>)
/include/navigation.php
/include/footer.php (close the boby and html tags as well)

then your page looks like

PHP Code:
<?
include("/include/dtd.php")
include(
"/include/htmltop.php")
?>
<title>Title bit</title>
<?
include("/include/charset.php")
include(
"/include/styles.php")
include(
"/include/closehead.php")
include
"(/include/navigation.php")
?>
The content for the body goes here

<?
include("/include/footer.php")
?>
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 05-31-2008, 04:08 PM Re: Inserting other pages into body of main page
Capt Quirk's Avatar
Extreme Talker

Posts: 202
Location: Flordidian
Quote:
Originally Posted by wayfarer07 View Post
It helps to have previous programming experience, but anyone with critical thinking skills and a desire to learn can grasp PHP.
I'm screwed...

Quote:
Originally Posted by chrishirst View Post

all you do is construct your page in little bits and let the server put it all together.

so you have a bunch of common pages;

/include/dtd.php Just the doctype in this page
/include/htmltop.php Just has <html> and <head>
/include/charset.php Just the character set
... other common elements
/include/styles.php stylesheet definition
/include/closehead.php (</head> & <body>)
/include/navigation.php
/include/footer.php (close the boby and html tags as well)

then your page looks like

PHP Code:
<?
include("/include/dtd.php")
include(
"/include/htmltop.php")
?>
<title>Title bit</title>
<?
include("/include/charset.php")
include(
"/include/styles.php")
include(
"/include/closehead.php")
include
"(/include/navigation.php")
?>
The content for the body goes here

<?
include("/include/footer.php")
?>
Is this close to correct? http://www.guitargarage.tv/php/
__________________
http://GuitarGarage.tv , up and limping along.
Capt Quirk is offline
Reply With Quote
View Public Profile
 
Old 05-31-2008, 04:36 PM Re: Inserting other pages into body of main page
chrishirst's Avatar
Super Moderator

Posts: 12,767
Location: Blackpool. UK
Quote:
Is this close to correct?
No idea, but as it renders as a complete page, with everything in the right places ....




... It must be
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 05-31-2008, 05:28 PM Re: Inserting other pages into body of main page
Capt Quirk's Avatar
Extreme Talker

Posts: 202
Location: Flordidian
At least something is going along as planned today
__________________
http://GuitarGarage.tv , up and limping along.
Capt Quirk is offline
Reply With Quote
View Public Profile
 
Old 05-31-2008, 07:47 PM Re: Inserting other pages into body of main page
Arenlor's Avatar
Ultra Talker

Posts: 463
Name: Jerod Lycett
Location: /home/arenlor
PHP = PHP Hypertext Preprocessor = Personal Home Page Hypertext Preprocessor, you don't have to use it, but you will tend to use it.
__________________
PHP Code:
<?php echo "Hello World"?>
HTML Code:
<html><head><title>Hello World</title></head><body><p>Hello World</p></body></html>
Arenlor is offline
Reply With Quote
View Public Profile Visit Arenlor's homepage!
 
Old 05-31-2008, 08:08 PM Re: Inserting other pages into body of main page
Capt Quirk's Avatar
Extreme Talker

Posts: 202
Location: Flordidian
I realize I don't HAVE to, but would like to use it to make things easier to edit, optimize the site, etc. I could do it in asp too, but php seems to be the easier route, for me anyways. I just want to be sure I'm not defeating the purpose by approaching it the wrong way.
__________________
http://GuitarGarage.tv , up and limping along.
Capt Quirk is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Inserting other pages into body of main page

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.16702 seconds with 12 queries