Someone Please Help me Get Started...

User 2388388 Photo


Registered User
129 posts

No... Im actually working on that right now. (Actually on Hold with my Host right now :rolleyes:)
User 38401 Photo


Senior Advisor
10,951 posts

Just for future reference, here's a few links (did a google search for "how to use SSI HTML" and there's quite a few that have info for this. I was in your shoes a few years ago too on this. I figured this part out, but still have yet to figure out how to install and use the xampp or whatever is needed to view it lol. Works slick just to upload it so it's all good.

http://www.perlscriptsjavascripts.com/t … o/ssi.html

http://library.thinkquest.org/15074/ssimain.html

http://httpd.apache.org/docs/current/howto/ssi.html

There were a bunch more, but that should get you started and just throw in that google search if you need more too :)
User 2212523 Photo


Registered User
88 posts

If you do choose to convert to php, when you use the php includes tag, it's best to use single the apostrophe instead of the quotation mark (single quotation not double). Example:

<?php include("z-end-of-head.php"); ?> should be:
<?php include('z-end-of-head.php'); ?>
User 122279 Photo


Senior Advisor
14,447 posts

I've never had any issues with double quotes, and I've been using them for the last 5 years or so.
Ha en riktig god dag!
Inger, Norway

My work in progress:
Components for Site Designer and the HTML Editor: https://mock-up.coffeecup.com


User 2388388 Photo


Registered User
129 posts

***Edit for Language*** I just realized something.

JRCDyer, I saw your post and immediately went and switched all of the double quotes on these HTML pages Im rebuilding to singles...

Now Im confused... What if I have a php include tag on an HTML page as follows:

Should I stick with Single or Double's??

Thanks again!!

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html dir="ltr" lang="en-US"><head>
<title>A Page About Something</title>
<meta name="Description" content="Some Content about Something">

<?php include 'z-end-of-head.php'; ?>

</head>
<body>

<h1>Some Important Text</h1>

</body>
</html>
User 2212523 Photo


Registered User
88 posts

That's fine, except you forgot the parentheses () around your include tag.

<?php include 'z-end-of-head.php'; ?>
Should be:
<?php include('z-end-of-head.php'); ?>

And if you don't change them to single quotations it will still work. It's just slightly more efficient to use singles when there are no variables to be interpreted in the php or objects to be parsed.
User 2388388 Photo


Registered User
129 posts

Hi JRCDyer,

Big Props to Your Mad Skills and thanks for all of your help!!

I have to ask before I set out to add parentheses's to about 300 tags...

If they're working now "As-Is" do I really need to add the Parentheses?

I just don't understand PHP (at all) and am just getting started and I greatly appreciate your help.

If you wouldn't mind sharing with me the difference between Parentheses and No Parentheses I'm all ears but for now I guess I'll be adding the Parentheses...

Thanks

User 2212523 Photo


Registered User
88 posts

If you have 300 pages that already have the double-quotes, if I were in your shoes, I'd skip it :lol:

The parentheses explanation is simple, though :D If you don't use them the call to include the file in another directory won't work. It's just like when you're adding a background image on your style.css If you want to include a background image, you need to place the image URL in parentheses like:

background: url('http://www.myurl.com/images/myimage.png');

Same goes with the php include:

<?php include('images/logo.png'); ?>



Another thing you might want to note is if you have pages in folders (not in your root) you'll have to add the ../ (two periods and a back slash) to your php includes.

For example, if you have a folder labeled "About" with an index.php and contact.php files inside that folder any php files you're including will look like this:

<?php include('../images/logo.png') ?>

folder within a folder:

<?php include('../../images/logo.png') ?>

and so on and so forth.

Just figured I'd mention that in case you became confused later on.

User 2388388 Photo


Registered User
129 posts

Hi JRCDyer,

Actually I have about 10 pages with 30'ish include tags on each that are done / converted from SSI to PHP includes but if they're missing best practices then now is the time to change things and develop a uniform pattern before I edit 150 pages with 30 include tags on each.

Thanks again and Thanks for pointing out the double dot. (isn't it best practice to keep my include files on the root?)

User 2212523 Photo


Registered User
88 posts

I think it's actually best practice to keep you include files in an include folder. That way you don't have to hunt for them every time you need to add a new link to the navigation or footer, or whatever else you're including.

Oh, and you're welcome. :D

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.