½. shtml - ½ .php

He has: 688 posts

Joined: Feb 2001

Half of my site is .shtml pages. The other half are .php pages (due to my forum). It all works out fine, but I'm interested in using a specific php menu code that says to put "<? include ( "header.php" ); ?> " in my php code. That should still work fine with my forum but what about the rest of my site? Will it work to just use include virtual "header.php" within my .shtml pages? Will the .php script "run" or just print out all the code?

Thanks

P.S. If it matters at all, the code I want to add is here:
http://www.mode-x.com/programming.freecode.php?target=modex.navigation.php

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

A conditional no. Apparently some versions of Apache (new) will allow this?

http://www.webmaster-forums.com/showthread.php?threadid=18342

This thread goes on about this at length. In general, you can't combine languages. I would recommend you move your site to all php.

He has: 688 posts

Joined: Feb 2001

Well that sucks for me. I don't know how to write any php code at all, and I don't feel like rewriting my entire site anyway. Is there anyway to "wrap" my shtml pages into a php shell? Okay, now that I see that I realize how dumb that sounds.

So for interactive features, if it's an entire self-contained page I can use either Perl of php because it's still only one language per each page), but for smaller elements that would be added to main content shtml pages via SSI call (counters, polls, whatever), there's no way to include php from within shtml but I can include perl from within shtml? Hmmm. I got some decisions I gotta make.

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

yeah. I know it can be done (all sorts of complex server side stuff) but I don't think it's one easily, if at all for most hostly situations. All that executing seems to me to be a major security risk. It's bad enough with client side issues.

You can still call perl scripts within the page, I think -- like in an image -- src="script.pl" -- or something? I guess it depends on what you're doing.

Smiling S

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

You can include PHP using SSI within .shtml pages. (same syntax as including CGI files)
You cannot use SSI within PERL pages.

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

Quote: Originally posted by Mark Hensler
You can include PHP using SSI within .shtml pages. (same syntax as including CGI files)
You cannot use SSI within PERL pages.

And it will execute any scripting?

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

Yes.

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

Well that's awesome! Thanks, Mark! Smiling

He has: 688 posts

Joined: Feb 2001

Yes, thank you Mark! Does this mean that I can call both php anf perl elements from within the same .shtml webpage? That would be great!!!

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

Yes, just use seperate SSI calls.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.