/    Sign up×
Community /Pin to ProfileBookmark

how to include image, SSI? Apache server

I’m going hog-wild – well, not really, but a little bit – beginning to use includes to save editing many pages.

Succeeded beautifully with links down the right sides of my new-layout pages (only three out of some 30 or more done so far – have to edit them to stick in the includes). (Visible on three of my pages: articles.htm, about.htm, index.htm (see signature for site).

Then I realized I’d been wanting to use includes for the masthead (banner) image and the footer one too. I got includes going for the footer text.

Also succeeded with image includes; they look like this:

[code]
<!–#include file=”include/codogacc.txt” –>
[/code]

and codogacc.txt looks like this:

[code]
<div id=”masthead”>
<a href=”index.htm”><img alt=”Where Eagles and Herons Watch Dogs (32KB)” title=”Where Eagles and Herons Watch Dogs” src=”images/logos/codogacc.jpg” /></a>
</div>
[/code]

I left the divs in there to make it easier for me to see where to put the include statement into the page, but duhhh! I just realized I don’t have to do that; I can put a comment in there (in a template), to show me where to put it.

But then I thought, well, that codocacc.txt looks as though there’s a kind of double whammy on the server. I have no idea! I wondered if I could “include only the image itself,” and if so, what would the coding look like?

I started trying, something like this:

[code]
<a href=”index.htm”><img alt=”Where Eagles and Herons Watch Dogs (32KB)” title=”Where Eagles and Herons Watch Dogs” src=”<!–#include file=”include/codogacc.jpg” –> /></a>
[/code]

ARGH! I was scared even to try that. It doesn’t look right to me at all!

It’s not right, is it? Or is it? should I dare try it?

Or is there another, better way to do it than the examples above?

Here is what I’m concerned with: making things as efficient as possible on the server and also for the visitor – load as quickly as possible, keep server load comfortable (whatever!) I don’t know what all the implications are, in case somebody would like to explain them to me.

Except, of course, for my editing; using SSIs makes my editing job much, much easier, if I want to change anything any time. Only have to edit the single, tiny included file. Once. Once only. Per change, haha!

Implications are? Thanks in advance!

Thu, 14 Apr 2005 17:26:53

to post a comment
HTML

2 Comments(s)

Copy linkTweet thisAlerts:
@IncaWarriorApr 15.2005 — that should work, but if you can use PHP and just stick in a variable there it would be better.
Copy linkTweet thisAlerts:
@CarolWauthorApr 15.2005 — Dear Inca Warrior - err, I mean, G_d - oops - g_D,

that should work, but if you can use PHP and just stick in a variable there it would be better.[/QUOTE]

Is that right? Too bad I don't understand your answer, though I surely would like to, and one day maybe I'll learn enough so I could [chortle!]

Questions:

1) can you give a code example?

2) would you? [haha]

3) Can I use PHP code (never mind that I don't know it; that doesn't matter if I can copy it [another haha] - insdie an HTML file (really, XHTML 1.0 Strict), and leave the DocType as it is? Maybe I've done so already, in a way; I do have variables in most of my pages; they look like this:

<i>
</i>&lt;p&gt;Last modified on&lt;br /&gt;
&lt;!--#echo var="LAST_MODIFIED" --&gt;&lt;/p&gt;


How did you guess I copied that from my ISP's docs?

Doesn't mean I understand it, but it works.

But that's not PHP code, is it? I don't see any "<? p ....." or whatever that stuff is.

Then would I have to rename my page, say, from *.htm to *.php? And can I mix *.htm and *.php pages on my site?

Soooooooooo many questions.

Thu, 14 Apr 2005 18:00:10
×

Success!

Help @CarolW spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.4,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...