SHTML to PHP<

I run a Movable Type site (at <!-- m --><a class="postlink" href="http://crowndozen.com">http://crowndozen.com</a><!-- m -->) and now that it's mostly done and I can rest, I of course am already thinking about re-doing the whole damn thing differently

What I'm thinking about doing is switching it from .shtml to .php, as it seems like the smart thing to do. Now, I have no idea, and I mean no clue, about php and so am going to teach myself.

If I remember correctly, I used shtml simply so i could use includes, so how hard will it be to switch to php? Can I go ahead and change my extensions and includes and everything still work?

Am I completely nuts and have completely skewed ideas and expectations? Will I cry when I realize how hard PHP is?PHP includes is very similar to SSI. Check out this thread, it's the same code I use.

<!-- m --><a class="postlink" href="http://www.htmlforums.com/showthread.php?s=&threadid=32364Thanks">http://www.htmlforums.com/showthread.ph ... 2364Thanks</a><!-- m -->! That answers part of my massive confusion :)You're wanting to use includes aren't you?Yeah! Well, maybe. I think ;)
Actually I was hoping I wouldn't need them once using PHP, but what do I know? If you know how MT works then this is what's up: I have 4 blogs that I weave into one. A main one that then display the output of the other 3. It's big, clumsy, 'heavy', easily broken, hard to change the design, etc.Well shtml and php includes are very similar. But with php includes you can use cases to include different files for different cases.Let me put part of my question like this. Can I go ahead and change my filenames from *.shtml to *.php and they still display correctly. That way I can switch them over to php little by little, testing and learning as I go? Well, after I cahnge the includes that you've helped with of course!Yep, changing the extension to php won't change anything. It will just make your SSI stop working.Ouch. That's a negatory. This is what I got when I tried to pull up <!-- m --><a class="postlink" href="http://crowndozen.com/main/about.php">http://crowndozen.com/main/about.php</a><!-- m -->
============================

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, <!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e --> and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.


------------------------------------------------
Apache/1.3.27 Server at <!-- w --><a class="postlink" href="http://www.crowndozen.com">www.crowndozen.com</a><!-- w --> Port 80

============================

Do know that I first tried that simple 'Hello World' echo thing from here <!-- m --><a class="postlink" href="http://us2.php.net/manual/en/tutorial.firstpage.php">http://us2.php.net/manual/en/tutorial.firstpage.php</a><!-- m --> first and it worked, so all the server stuff shoulda been good to go. Sigh.does your server support php?Do know that I first tried that simple 'Hello World' echo thing from here <!-- m --><a class="postlink" href="http://us2.php.net/manual/en/tutorial.firstpage.php">http://us2.php.net/manual/en/tutorial.firstpage.php</a><!-- m --> first and it worked, so all the server stuff shoulda been good to go. Sigh.

Like I said, I tried that echo thing first and it worked, check it: <!-- m --><a class="postlink" href="http://www.crowndozen.com/hello.phpIf">http://www.crowndozen.com/hello.phpIf</a><!-- m --> it's not a risk, can you post your code within about.php? Would be easier to see if the problem is within it. Thanks :-)

-TimoSure, but do you need the Movable Type template, or just the resulting HTML?

The source is on <!-- m --><a class="postlink" href="http://crowndozen.com/main/about.shtml">http://crowndozen.com/main/about.shtml</a><!-- m --> because Ill I did was publishthe same thing, but with a .php instead of .shtmlOh hmm... I never used shtml before so was wondering if you had used functions or something. (I probably sound really dumb right now, but never touched the stuff.)

There shouldn't be a problem... Hmm what do your include statements look like?

<?php include('file.php');?> or <?php include 'file.php';?> both should work. Or there are other methods, but not every server is configured to allow them like some servers turn off file input and exporting...you cannot just rename your file to .php. the contents have to contain php tags.

<?php

?>

those have to be in therephp includes


<? include ("header.htm"); ?>


SSI


<!--#include virtual="header.htm" -->



*edit* added the quotes in the php include... thanks illogique... don't know what the h3ll i was thinking :rolleyes: :POriginally posted by scoutt
you cannot just rename your file to .php. the contents have to contain php tags.

<?php

?>

those have to be in there

if the contents is dynamic, yes

you can have plain html file name .php
without anything php inside!

Originally posted by karinne
<? include (header.htm); ?>


you need ' ' or " " around the filename!!
the () are optionalyes I know, I didn't explain that too well. I agree with what you said but if he is including files then the file doing the include has to be .php

you can't use php includes in a .shtml file and vice-versa.
 
Back
Top