Forum Moderators: coopster

Message Too Old, No Replies

Include problem

fileNice browser include to toher page

         

bethesda

1:56 pm on Dec 1, 2011 (gmt 0)

10+ Year Member



Hello again.

This time, I have another problem.
I have a script called (fileNice) that provides contents of the directory.
I copied the script to a directory (/ / main / test / browser / index.php)
Now I want to run a script (/ / main / test.php)

In the body of the script (test.php) I want to use function:
(include 'test / browser / index.php';)

Unfortunately, when I run (test.php) show a cosmic crap.
He show me directory (/ / main) which is absolutely unacceptable, I can practically download and read all the scripts in this directory (/ / main).

How can I run the script in a different directory from another script in a different directory?

penders

2:52 pm on Dec 1, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Unfortunately, when I run (test.php) show a cosmic crap.


What is "a cosmic crap"?

How can I run the script in a different directory from another script in a different directory?


Well, you seem to be doing this already, but the output from a different directory... This will depend on the script. How does the script determine which directory it displays? May be you need to pass the directory to the script (if it currently supports that)?

bethesda

3:38 pm on Dec 1, 2011 (gmt 0)

10+ Year Member




What is "a cosmic crap"?


Nonsens ;)


Well, you seem to be doing this already, but the output from a different directory... This will depend on the script. How does the script determine which directory it displays? May be you need to pass the directory to the script (if it currently supports that)?


Well i think about it - i try use
iframe
.
Script show contents of the directory in which it is placed.

lostdreamer

10:00 am on Dec 2, 2011 (gmt 0)

10+ Year Member



You could try chdir

chdir("/full/path/to/folder");


It just might work....
Otherwise there is probably a line with something like


$dir = "./";


If so, you can change the ./ to the full path of your folder

bethesda

10:15 am on Dec 2, 2011 (gmt 0)

10+ Year Member



Browser works fine. You right - i need to change code inside the script.

Now i try to fight with google maps API.
Well, i have a page in //catalog/catalog/maps.html - and i need to put it to my //index.php.

Thanks for the tip - i try it that way.