View Full Version : Can Anybody Tell This
modstudioindia
1st July 06, 12:17 PM
I want the solution from my friends here. Suppose I have a page named index.php under root folder. There is a folder say about-me and a file say about-me/who-am-i.html. Is there any way to include it on index.php. I have seen that if the page is in root drive then I can embed it using the following tag :
<? include "who-am-i.html"; ?>
This like <? include "/about-me/who-am-i.html"; ?> doesn't work.
Why? Is there any way else to include?
However I don't want to use iframe or frame - anyway. I want PHP.
Waiting to see a solution from my friends.
> Suppose I have a page named index.php under root folder. There is a folder say about-me and a file say about-me/who-am-i.html
Put this in index.php file:
<? include ("/about-me/who-am-i.html"); ?>
carinamalmgren
1st July 06, 06:13 PM
edit: designgraphy where faster so... never mind
quiller
27th July 06, 09:59 PM
Sorry for coming in late, but it should be pointed out that both code snippets are using absolute paths, which (depending on the server) likely extend further back than the web-viewable folder. Most *nix servers will have a more complex structure, such as /web/sites/domain/www/, meaning an absolute path would like like:
<?php include("/web/sites/domain.com/www/about-me/who-am-i.html"); ?>
You could also use a relative request by dropping the initial slash:
<?php include("about-me/who-am-i.html"); ?>
Apologies if this post was unnecessary or likenot.
marks
27th July 06, 10:21 PM
Sorry for coming in late, but it should be pointed out that both code snippets are using absolute paths, which (depending on the server) likely extend further back than the web-viewable folder. Most *nix servers will have a more complex structure, such as /web/sites/domain/www/, meaning an absolute path would like like:
<?php include("/web/sites/domain.com/www/about-me/who-am-i.html"); ?>
You could also use a relative request by dropping the initial slash:
<?php include("about-me/who-am-i.html"); ?>
Apologies if this post was unnecessary or likenot.
Indeed; to be safe, try using a relative path to the file for inclusion
vBulletin® v3.8.4, Copyright ©2000-2013, Jelsoft Enterprises Ltd.