nzrubin
asked on
keep path in including file
Hello Guys
little question!
is it possible to keep paths on remote file that i include in other page?
for exmpl i include file
include ("../../TextEditor/example s/textEdit or.php");
but the file textEditor.php has his own links to remote files like
<script language="JavaScript" type="text/javascript" src="../cbrte/html2xhtml.j s">
</script>
<script language="JavaScript" type="text/javascript" src="../cbrte/richtext_com pressed.js "></script >
and when i include file in some page the file (of course) doesnt work properly cos it lost paths to java files
little question!
is it possible to keep paths on remote file that i include in other page?
for exmpl i include file
include ("../../TextEditor/example
but the file textEditor.php has his own links to remote files like
<script language="JavaScript" type="text/javascript" src="../cbrte/html2xhtml.j
</script>
<script language="JavaScript" type="text/javascript" src="../cbrte/richtext_com
and when i include file in some page the file (of course) doesnt work properly cos it lost paths to java files
If the links in textEditor.php are other PHP files then they are relative to the included file. However, as you are outputting Javascript then you will need to change your paths in textEditor.php so they are relative to the original script that is making the call.
If you have multiple scripts in multiple areas that call textEditor.php then you will need the change the links in textEditor.php to something like:
If you have multiple scripts in multiple areas that call textEditor.php then you will need the change the links in textEditor.php to something like:
<script language="JavaScript" type="text/javascript" src="/directory/structure/cbrte/html2xhtml.js">
OR
<script language="JavaScript" type="text/javascript" src="http://www.xxx.xxx/directory/structure/cbrte/html2xhtml.js">
OR
echo '<script language="JavaScript" type="text/javascript" src="' . $_SERVER['DOCUMENT_ROOT'] . '/directory/structure/cbrte/html2xhtml.js">';
Is there an echo inn here? ; )
Actually, don't use my second php example as the / is only good for client side. And don't use $_SERVER['DOCUMENT_ROOT'] for javascript, as it is the absolute path from root on the server.
Actually, don't use my second php example as the / is only good for client side. And don't use $_SERVER['DOCUMENT_ROOT'] for javascript, as it is the absolute path from root on the server.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window