On one perl page that prints out links to itself with ?variable=value on them so it prints out new info.
This value is a directory name. The info is the contents of the directory.
So I can go to this file and click links to view the contents of other directories.
At the top of this multi-tasking perl page is a printed out line of what directory on the server I am viewing, this is printed out from a hard set variable and the sent value.
I want to be able to use this printed out line to have each directory name turned into a link that links again to this same file but with the new value.
its a bit like this:
#!/usr/bin/perl
use CGI;
$query = new CGI;
$dire = $query->param("dire");
print $query->header ( );
$live = "/home/client/www/site";
print "$live<a href=\"./index.cgi?dire=$dire\">$dire</a>";
print "<br><br>"
#then my readdir which reads $live$dire and prints out the contents
So when I click on the linked part it takes me to view the contents of that directory. Simple.
This works fine when I am in "/html" and $dire is "/html" But not when I am in "/html/code" and $dire is "/html/code".
When it is this case and it prints out
home/client/www/site/html/code
I want to be able to click on the "html" part of that line and have it take me to "./index.cgi?dire=/html"
or to click the "code" part of that line and have it take me to "./index.cgi?dire=/html/code"
You get the idea, i want to be able to move back directories. How can I split up $dire and print it out as separate links?
Thank you for any help or pointers. I tried my best to describe the problem but if it's not clear let me know!