change msg file type

Is message board greying out your hair (at least what's left of it)? Let us help you here
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

Ok, this should work then:

Code: Select all

$content.='<!--#include virtual="../footer.txt" -->';
Note that file has been changed to virtual
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Henrie
Posts: 1095
Joined: Sun Aug 14, 2005 8:57 pm

Post by Henrie »

That will probably also not work. I did some looking around.

<!--#include file="included.html" -->

The format above will create an SSI that will include the text found in the file "included.html".

You use "file=" when the file that will be included is held within the same directory as the file that is calling for it. You can also use the file argument when the file is within a subdirectory of the directory containing the file that is calling for it.


<!--#include virtual="/directory/included.html" -->

You would use the virtual argument if the file you are calling for is located in a position requiring an address starting at the server root. That's an academic way of saying the file isn't in the same directory as the page that's calling for it.
That forward slash before the first directory is representative of the domain name (server root). By using that leading slash, the server will add the domain name to the front of the address for you.

So ../ will also not work when using virtual. You will have to add the path starting from the server root.

Greetings,
Henrie
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

virtual="../footer.txt" works on my server, give it a go :wink:
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Henrie
Posts: 1095
Joined: Sun Aug 14, 2005 8:57 pm

Post by Henrie »

I just tested some more.
At home on my localhost webserver (aprelium under windows) ../ did not work. Online at a linux server (apache) ../ did work.
So i guess it depends on the webserver that is used.

But the online documentation says dat virtual needs a path from the base directory of the webserver.

Greetings,
Henrie
icepack
Posts: 70
Joined: Mon Oct 15, 2007 1:38 pm

Post by icepack »

i believe i'm on redhat-linux so your suggestion is to change:

$content.=$footer;

to

$content.='<!--#include virtual="../footer.txt" -->';

am i right in thinking it will use the footer from my root directory, i.e. http://www.mydomain.com/footer.txt

so if i wanted to use a footer stored in a folder named mboard, i should use something like http://www.mydomain.com/mboard/footer.txt

will give it a go then!
[b][color=red][url=http://ilumu.com]UK Website Design Specialists - ILUMU.COM[/url][/color][/b]
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

Use $content.='<!--#include virtual="../footer.txt" -->'; and it should use your MBoard footer.txt (note that messages are in a lower folder, mboard/msg).

Just give it a try and see what happens.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
icepack
Posts: 70
Joined: Mon Oct 15, 2007 1:38 pm

Post by icepack »

you guys are absolutely spendid! i did it for my header too, and it's all working like a dream. thanks! you're both pure genuis!!! :D thanks!!!

this is a bit off topic, but klemen, with regard to the image upload i bought of you, when do you think you'll be able code it so removal of the images occurs when the post is deleted?
[b][color=red][url=http://ilumu.com]UK Website Design Specialists - ILUMU.COM[/url][/color][/b]
Locked