-
February 18th, 2003, 08:22 PM
#1
Can this be done
I am interested in finding (if anything to find) a script that will make it so I can veiw my weblogs from a browser. I currently can only look at them threw pico using my shell and it is kindof crazy looking. Anyone know of a way to do this
Violence breeds violence
we need a world court
not a republican with his hands covered in oil and military hardware lecturing us on world security!
-
February 18th, 2003, 09:00 PM
#2
ooh, i do this kind of stuff all the time...
in perl:
Code:
print "Content-Type: text/html\n\n";
opendir(DIRECTORY, '.') or die ("Can't open DIRECTORY");
@DIRSCAN = readdir(DIRECTORY);
closedir DIRECTORY;
foreach (@DIRSCAN) {
if (/.htm/) { print "<a href=$_>$_</a>
";}
if (/.txt/) { print "<a href=$_>$_</a>
";}
if (/.php/) { print "<a href=$_>$_</a>
";}
if (/.pl/) { print "<a href=$_>$_</a>
";}
if (/.etc/) { print "<a href=$_>$_</a>
";}
}
h4h4h4- that only took 2 minutes
i don't know if this is what you want? maybe i can still help?
yeah, I\'m gonna need that by friday...
-
February 18th, 2003, 09:08 PM
#3
Thank you.. I will try that for now. I just re read my post though and see where i messed up. What I meant to say was a php script that does this.... But if none this perl script will due just fine
Violence breeds violence
we need a world court
not a republican with his hands covered in oil and military hardware lecturing us on world security!
-
February 19th, 2003, 12:56 PM
#4
Re: Can this be done
Originally posted here by Euclid
I am interested in finding (if anything to find) a script that will make it so I can veiw my weblogs from a browser. I currently can only look at them threw pico using my shell and it is kindof crazy looking. Anyone know of a way to do this
PHP Code:
<html>
<body>
<?php
$dir = @opendir(".");
$extention_array = array(
".txt$",
".log$",
".etc$"
);
$while( $file = @readdir($dir) )
{
if( ereg($extention_array, $file) )
{
echo('[url="'.$file.'"]'.$file.'[/url] ');
}
}
@closedir($dir);
?>
</body>
</html>
Check out www.hotscripts.com or www.sf.net for more detailed, bigger, scripts.
-
February 19th, 2003, 02:33 PM
#5
Parse error: parse error, unexpected '{' in C:\ ...\dir.php on line 12
Am i doing something wrong?
yeah, I\'m gonna need that by friday...
-
February 19th, 2003, 06:43 PM
#6
by the looks of it you have an extra { somwhere in your code
SittingDuck
I\'m a SittingDuck, but the question is \"Is your web app a Sitting Duck?\"
-
February 19th, 2003, 09:09 PM
#7
wooops, sorry bout that. one dollar sign to much.
PHP Code:
<?php
<html>
<body>
<?php
$dir = @opendir(".");
$extention_array = array(
".txt$",
".log$",
".etc$"
);
while( $file = @readdir($dir) )
{
if( ereg($extention_array, $file) )
{
echo('[url="'.$file.'"]'.$file.'[/url] ');
}
}
@closedir($dir);
?>
</body>
</html>
-
February 20th, 2003, 01:19 AM
#8
Junior Member
<?php
$dir = @opendir(".");
$extention_array = array(
".txt$",
".log$",
".etc$"
);
while( $file = @readdir($dir) )
{
if( ereg($extention_array, $file) )
{
echo(''.$file.'
');
}
}
@closedir($dir);
?>
What excatly should this do, i only get a white page
Am i doing something wrong ?
-
February 22nd, 2003, 01:04 AM
#9
Plant this script in your log directory.
Or, if you have it in another directory, then change the
PHP Code:
$dir = @opendir(".");
to
PHP Code:
$dir = @opendir("your_log_dir/somewhere_deeper/right_over_here/");
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|