Click to See Complete Forum and Search --> : display output from other php file


hhayes
10-14-2005, 07:54 AM
Hi-

I have a maze of files that I'm trying to index.

Everything works well except that the indicies that I'm creating only work in the one directory where they are located. Any other directory, the links no longer work.

Short question is, how do I get the output from

output_1.php
output_2.php and
output_3.php

into

output_all.php

specifically, the individual index files look like this-

$path = ".";
$dir = opendir($path);
while ($file = readdir($dir))
if ($file != "." && $file != "index.php" && $file != ".." && $file != "menu.php" && $file != "csshover.htc" && $file != "admin_menu.php" && $file != "Genetics_index_menu.php" && $file != "Genetics_Index.php") {
$time = filemtime("$path/$file");
$page_name=substr($file, 0, strpos($file, "."));
$page_name = str_replace("_", " ", $page_name);
$data[$time] = 'foo' . $i;
$data[$time] = "<a href=\"$path/$file\" class=\"black noBREAK\">$page_name" .'</a>';
}
ksort($data);
echo "<ul>";
foreach ($data as $k => $v)
echo "<li>$v\n";
echo "</ul>";

and I tried to include a group of those files into an admin directory,

echo "<font face=\"Trebuchet MS, Verdana, sans-serif\">Genetics</font>";
include("http://www.bmdca.org/health/Genetics/admin_menu.php");

on that admin page, the links end up like this-
http://www.bmdca.org/health/admin/Genetics/admin_menu.php but,
http://www.bmdca.org/health/Genetics/admin_menu.php
is what I need.
That extra "admin" keeps ending up in the link.

I don't seem to be able to ask the right questions at the php manual site. I've had a bunch of things come close to what I want, but I keep ending up with bad paths or broken links.

Thanks in advance,
Take care.

Hugh

spinnyscripter
10-14-2005, 08:19 AM
The link that you havce given us for the admin version dosent work. I had a look around and i found it in http://www.bmdca.org/health/admin/ not http://www.bmdca.org/health/admin/Genetics/

This is listing the admin files in the admin directory.
are you trying to list the files in the /health/admin/ directory?
or are you are trying to index the files in the /health/Genetics/ Directory?

try replacing the $path variable from the original script with thef ull HREF in the listing and see what that does?

hhayes
10-14-2005, 10:14 AM
Hail the all-noing!

>trying to index the files in the /health/Genetics/ Directory?

yep, that the directory that I'm indexing, but I want to display that index on a page in the /health/admin/ directory.

This is the one that I'd like to use

http://www.bmdca.org/health/admin/menus.php

there, the links are ending up as

http://www.bmdca.org/health/admin/Genetics/Hepatocerebellar_Degeneration.php

instead of

http://www.bmdca.org/health/Genetics/Hepatocerebellar_Degeneration.php

Thanks, Hugh

spinnyscripter
10-14-2005, 01:31 PM
isted of
$path = ".";

try

$path = "http://www.bmdca.org/health/Genetics/";
and see what happens.

hhayes
10-15-2005, 07:14 PM
Thank you No. You are all.