Welcome Guest!
Please login
If you do not have an account yet on The Web Squeeze forums, please Register! It’s FREE and there are many benefits:
- Receive Fast Advice
- Learn Programming Languages
- Get Professional Website Reviews
- Quick Troubleshooting Assistance
|
|
Ssi
This is a discussion on Ssi, within the Beginners' Questions section. This forum and the thread "Ssi" are both part of the Designing Your Website category.
![]() ![]() |
Apr 10 2008, 09:25 PM
Post
#1
|
|
![]() Rapid Squeezer ![]() ![]() ![]() ![]() Posts: 206 Joined: 15-February 08 From: Plymouth |
I went to dreamweaver's site for help as I wanted to know if lib files can be used 'cross-domain' and they can't as they're obviously just code snippets (which I'm sure everyone here knows - but I ask too many questions anyway!). They suggested Server Side Includes
Identical information is necessary for 3 different domains and instead of copy and paste, is there anything else that can be done? If anything changes it's a pain (not to mention time consuming) to alter more than one document/page. It's not always viable to do a "find and replace" en-masse via DW, plus it has been known to crash when doing this, losing information. Been there, done that! I'm rapidly losing the will to live now. Thanks in advance. Popje -------------------- QUOTE I'm challenged enough without any extra weirdness in my life! |
|
|
Apr 10 2008, 10:57 PM
Post
#2
|
|
![]() Rapid Squeezer ![]() ![]() ![]() ![]() Posts: 171 Joined: 15-February 08 From: US of A |
simplest solution is php or ASP.
CODE PHP include: <?php include(http://www.sitename.com/filename.htm); ?> ASP Include: <!--#include virtual="insertthisfile.html" --> You don't HAVE to change all the other pages extensions. Normally you would but you don't have to. Also you don't have to change any of the code at all besides adding one of the includes above. -------------------- Currently Available for work: - XTHML, CSS, Flash, Actionscript, PHP, ASP, Ajax -
interested in movies? Read some of my reviews on my blog |
|
|
Apr 11 2008, 08:22 AM
Post
#3
|
|
![]() Co-Founder ![]() Posts: 3,103 Joined: 13-February 08 From: my little igloo up north |
SSI's use the same code as ASP but you're files in which you are putting the <!--#include ... > need to have an .shtml extension.
-------------------- a web design portfolio | web non-sense - REDESIGNED!
I'm also on: del.icio.us | flickr | virb | facebook | twitter The Web Squeeze is also on: twitter | virb | facebook | stumbleupon |
|
|
Apr 11 2008, 09:50 AM
Post
#4
|
|
![]() Rapid Squeezer ![]() Posts: 239 Joined: 14-February 08 From: NY, USA |
Hey Popje,
OK, first thing, SSI has nothing to do with ASP, PHP or CFM, so don't sweat it. SSI stands for "Server Side Include", which basically means that the server includes a file, or some other things, for you when you ask it to. Now, let's say you have a layout you want to use through out your website, but you want to change a certain section of the code - say the central content. You would end up with something like this.... Template page: (let's say index.shtml) CODE <html> <body> <head> <title>My Cool SSI'd Site!</title> </head> <body> <!--#include virtual="welcome.html" --> </body> </html> Content Pages: (welcome.html in this case, but could be anything - .txt, .inc, .etc) CODE Welcome to my cool new SSI'd website! Hope you like it. <br /> <br /> Oh, and don't forget to get your squeeze on! <br /> <a href="http://www.thewebsqueeze.com/">The Web Squeeze</a> When the server does it's thing, your code should look like this... CODE <html> <body> <head> <title>My Cool SSI'd Site!</title> </head> <body> Welcome to my cool new SSI'd website! Hope you like it. <br /> <br /> Oh, and don't forget to get your squeeze on! <br /> <a href="http://www.thewebsqueeze.com/">The Web Squeeze</a> </body> </html> One thing to remember... your included files should not have <html>, <head> or <body> tags as this will usually break everything. In general, a file must end with .shtml in order for it to be "executed", or to actually include the other files. Also, the server must have SSI turned on for it to work. And, just so you know, you can change these settings using your .htaccess file, but I definitely suggest getting it working before you attempt to change anything. EDIT: Here's a link so you can see some of the other stuff you can do with SSI... http://en.wikipedia.org/wiki/Server_Side_Includes Hope this helps! Rich -------------------- |
|
|
Apr 12 2008, 06:31 PM
Post
#5
|
|
![]() Rapid Squeezer ![]() ![]() ![]() ![]() Posts: 206 Joined: 15-February 08 From: Plymouth |
Hey Popje, OK, first thing, SSI has nothing to do with ASP, PHP or CFM, so don't sweat it. SSI stands for "Server Side Include", which basically means that the server includes a file, or some other things, for you when you ask it to. [edit] Hope this helps! Rich Helps??!! This is fantastic! It's solved this problem for me, so thank you so much for your help (and patience). Karinne & Justin - Thank you both. I would be really lost without the help that I receive from everyone here. This is going to help me so much. Thank you, thank you, thank you! Please (if it's okay with everyone) consider yourselves hugged by an extremely grateful learner! May I impose again and ask if I should change all the extensions. I know Justin said I didn't HAVE to, but will the site look 'unprofessional' if there are a mixture of extensions? I don't want to give the wrong impression (I KNOW I'm still learning, but the public don't need to know that fact - do they? The more I learn - the more I realise I knew nothing at all to begin with. I feel like Homer Simpson when he said that every time he learnt something new, some of the old stuff got pushed out! This post has been edited by Popje: Apr 12 2008, 08:48 PM -------------------- QUOTE I'm challenged enough without any extra weirdness in my life! |
|
|
Apr 12 2008, 09:45 PM
Post
#6
|
|
![]() Co-Founder ![]() Posts: 3,103 Joined: 13-February 08 From: my little igloo up north |
May I impose again and ask if I should change all the extensions. I know Justin said I didn't HAVE to, but will the site look 'unprofessional' if there are a mixture of extensions? I don't want to give the wrong impression (I KNOW I'm still learning, but the public don't need to know that fact - do they? I would change all the extensions to match but that's just me. Every file that is using an include statement must have a .shtml extension. Also I visited the wikipedia page and now I'm a bit confused again as to just what is the difference between 'file' and 'virtual'? The difference between virtual and file is file you can use if the included file is in the same directory. Virtual is better because you can use absolute links CODE <!--include virtual="/includes/sidebar.inc" -->
-------------------- a web design portfolio | web non-sense - REDESIGNED!
I'm also on: del.icio.us | flickr | virb | facebook | twitter The Web Squeeze is also on: twitter | virb | facebook | stumbleupon |
|
|
Apr 12 2008, 09:50 PM
Post
#7
|
|
![]() Rapid Squeezer ![]() ![]() ![]() ![]() Posts: 206 Joined: 15-February 08 From: Plymouth |
I would change all the extensions to match but that's just me. Every file that is using an include statement must have a .shtml extension. The difference between virtual and file is file you can use if the included file is in the same directory. Virtual is better because you can use absolute links Oh, I get it now! Thanks This post has been edited by Popje: Apr 12 2008, 09:50 PM -------------------- QUOTE I'm challenged enough without any extra weirdness in my life! |
|
|
Apr 12 2008, 10:50 PM
Post
#8
|
|
![]() Rapid Squeezer ![]() Posts: 239 Joined: 14-February 08 From: NY, USA |
QUOTE The more I learn - the more I realise I knew nothing at all to begin with. Yup! I know the feeling... QUOTE Figuring things out. Realizing that the more I figure out the less I understand. Understanding that realization is figurative. Personally I think you'd be fine with either extension, but it's less confusing for you if you don't have to think about it and more consistent. QUOTE I KNOW I'm still learning, but the public don't need to know that fact - do they? The "public", as in those people who are not web geeks like all of us probably wouldn't even know the difference, nor would they care so long as everything worked and they got the info they were looking for. There's nothing wrong with using SSI includes whatsoever... it's a personal preference... just like PHP vs ASP vs Python vs Perl. (oh man are there gonna be a flood of responses on that one! lol) Rich -------------------- |
|
|
Apr 13 2008, 04:32 AM
Post
#9
|
|
|
Squeeze Machine ![]() Posts: 677 Joined: 15-February 08 From: UK |
There's nothing wrong with using SSI includes whatsoever... it's a personal preference... just like PHP vs ASP vs Python vs Perl. True, but it's worth knowing that SSI is very limited in what it can do. I started with SSI, and then Rakuli convinced me to try PHP; PHP allowed me to abstract away a lot more of the repetitive code elements. For example, my breadcrumb navigation is now created automatically with PHP. When I was still using SSI, I had to write it out by hand for every page! So SSI saves you time when elements are exactly the same on multiple pages (just include the whole lot), but PHP goes further by allowing you to automate elements that have a consistent structure without being identical. I've saved myself a huge amount of coding by switching from SSI to PHP. This post has been edited by MikeHopley: Apr 13 2008, 04:33 AM |
|
|
Apr 16 2008, 07:38 PM
Post
#10
|
|
![]() Rapid Squeezer ![]() ![]() ![]() ![]() Posts: 206 Joined: 15-February 08 From: Plymouth |
True, but it's worth knowing that SSI is very limited in what it can do. I started with SSI, and then Rakuli convinced me to try PHP; PHP allowed me to abstract away a lot more of the repetitive code elements. For example, my breadcrumb navigation is now created automatically with PHP. When I was still using SSI, I had to write it out by hand for every page! So SSI saves you time when elements are exactly the same on multiple pages (just include the whole lot), but PHP goes further by allowing you to automate elements that have a consistent structure without being identical. I've saved myself a huge amount of coding by switching from SSI to PHP. Maybe one day if things go easier for me, I'll try my hand at PHP, but for now seeing as everything will be identical, SSI is the way to go for me. PHP seems complicated anyway - maybe one day *sigh* -------------------- QUOTE I'm challenged enough without any extra weirdness in my life! |
|
|
Apr 16 2008, 08:12 PM
Post
#11
|
|
![]() Co-Founder ![]() Posts: 3,103 Joined: 13-February 08 From: my little igloo up north |
PHP includes are just as easy really ... same technique needs to be used so there really isn't much difference.
-------------------- a web design portfolio | web non-sense - REDESIGNED!
I'm also on: del.icio.us | flickr | virb | facebook | twitter The Web Squeeze is also on: twitter | virb | facebook | stumbleupon |
|
|
Apr 17 2008, 03:49 AM
Post
#12
|
|
|
Squeeze Machine ![]() Posts: 677 Joined: 15-February 08 From: UK |
PHP seems complicated anyway - maybe one day *sigh* That's what I felt before I tried it. I assumed that "more powerful" ==> "more complicated". But it wasn't true. With both PHP and SSI includes, the hardest part is setting up the webserver. |
|
|
Apr 17 2008, 06:42 AM
Post
#13
|
|
![]() Co-Founder ![]() Posts: 3,103 Joined: 13-February 08 From: my little igloo up north |
With both PHP and SSI includes, the hardest part is setting up the webserver. Or if everything is already done for you -------------------- a web design portfolio | web non-sense - REDESIGNED!
I'm also on: del.icio.us | flickr | virb | facebook | twitter The Web Squeeze is also on: twitter | virb | facebook | stumbleupon |
|
|
Apr 17 2008, 11:15 AM
Post
#14
|
|
![]() Rapid Squeezer ![]() ![]() ![]() ![]() Posts: 206 Joined: 15-February 08 From: Plymouth |
That's what I felt before I tried it. I assumed that "more powerful" ==> "more complicated". But it wasn't true. With both PHP and SSI includes, the hardest part is setting up the webserver. Yeah, that's how I feel about it. Bearing in mind your talking to me here: WAMP (Windows Apache MySQL and PHP) sounds terrifying, as does LAMP (yes, I've looked them up!). MySQL sounds even worse 'database technology' - makes me want to cry. -------------------- QUOTE I'm challenged enough without any extra weirdness in my life! |
|
|
Apr 17 2008, 11:16 AM
Post
#15
|
|
![]() Rapid Squeezer ![]() ![]() ![]() ![]() Posts: 206 Joined: 15-February 08 From: Plymouth |
Or if everything is already done for you That's sounds great - but still scary! -------------------- QUOTE I'm challenged enough without any extra weirdness in my life! |
|
|
Apr 17 2008, 11:20 AM
Post
#16
|
|
![]() Co-Founder ![]() Posts: 3,103 Joined: 13-February 08 From: my little igloo up north |
Like I said previously... doing php includes or ssi includes ... there isn't one lick of difference except the code
php CODE <?php include('page.html') ?> ssi CODE <!--#include virtual="welcome.html" --> Either way, your sever needs to be setup for one or the other. -------------------- a web design portfolio | web non-sense - REDESIGNED!
I'm also on: del.icio.us | flickr | virb | facebook | twitter The Web Squeeze is also on: twitter | virb | facebook | stumbleupon |
|
|
Apr 17 2008, 02:55 PM
Post
#17
|
|
![]() Rapid Squeezer ![]() Posts: 239 Joined: 14-February 08 From: NY, USA |
QUOTE Yeah, that's how I feel about it. Bearing in mind your talking to me here: WAMP (Windows Apache MySQL and PHP) sounds terrifying, as does LAMP (yes, I've looked them up!). MySQL sounds even worse 'database technology' - makes me want to cry. blink.gif Well I don't think I would recommend trying to setup a server just yet... but I would definitely recommend trying PHP. It's really easy once you have a few basic concepts down... Then it's just a matter of learning the syntax of the language (whether it be PHP, ASP, JavaScript). When I first learned how to program it was in JavaScript, and then I just applied it to ASP, then ActionScript, then PHP. For example, including a file in PHP vs SSI is just a matter of changing the syntax... like Karrine posted above. It does exactly the same thing. A FOR loop always does the same thing, as does an IF ELSE THEN. A rose by any other name, if you will. I would suggest getting yourself a free php host so you can play around with PHP before worrying about setting up a server. Or just setup a subdomain on an existing site and use that. Rich -------------------- |
|
|
Apr 17 2008, 03:30 PM
|






Apr 10 2008, 09:25 PM









