Lord help us all I’ve been put in charge of the website! lol
I am trying to get either SSI includes or PHP includes to work on my site. I’m starting small with the date…
Here’s my problem. I know PHP is installed on the server because I have submit form on there that I made with Flash and use PHP to run.
On my index page I tried a PHP include:
<?php include('date.html'); ?>
and I tried an SSI
<!--#echo var="DATE_LOCAL" -->
I can’t get the PHP include to work at all and the SSI include works if I change the file name to index.shtml but when I do that I get a listing of all files on my site instead of the index page.
My website is www.soacorp.com if that helps at all.
Much thanks
JustSara
Your PHP includes should obviously be in a page that has the extension .php.
And the include tag should look something like this…
<? include("yourFile.txt") ?>
And as for your SSI includes… I don’t see why it would list all your files. To me that doesn’t seem like something an include could do. Could be something else in your file that is conflicting with the .shtml extention I guess.
If that link was supposed to be to the page where the error with the .shtml extension occurs, I don’t see any problem on there :-\
Heh, I had the actual code in my original message but it didn’t show it. You’re absolutely right, to use the PHP file my page should have been index.php but when I changed it to that the include still won’t show up. :’’-(
The SSI include isn’t what is showing all my files. When I changed index.htm to index.shtm the browser didn’t see it as the ‘index’ page at all and instead listed the entire directory.
With the PHP… are you 100% positive that the files are linked directly.
I know if you are using programs such as Dreamweaver for Frontpage they have a habit of writing the full URL of the file on your hard drive instead of the URL it would be on in the server.
As for the SSI… that is friggin weird. I know some servers allow you to use SSI while having the extention .html, but others force you to have the extention .shtml for the SSI to work. But if .shtml doesn’t work, your page will still load, it just won’t show the includes.
Did you talk to the your host or the server tech support?
sigh Somedays I forget how to spell my own name and I think this is one of them. I’ve tried your suggetions but it’s still not working. I have a test page up at www.soacorp.com/date.html The date and time should show but it doesn’t and I’m completely frustrated. Could you please take a look?
Sara
P.S. I’d rather use PHP then HTML but… baby steps… =)
I’m trying to do 2 things. I really am trying to get the time to show on my pages but I’m mostly trying to figure out how to use Server Side Includes. I thought I’d start with something simple, like the time, but it’s not working out very well. shrugs I might have to break down and buy a book.
redViper… I changed the “virtual” to “file” and nothing showed up. I also changed the “html” to “shtml” and still nothing showed up. I’m getting ready to put the blame on my ISP. =)
*Originally posted by redViper *
**yea, for SSI you need a .txt file, and not php/html. and im 99% sure the file has to be .shtml - but im not 1% sure… **
It depends on your server. Certain servers (such as linux) require the file to be .shtml extentions, but others allow you to use .html.
Also, I believe some servers also make you use .shtm because it can only read 4 letter extentions. Maybe try that JustSara.