Sincerely,<?
$dir_handle = @opendir("./") or die("Unable to open directory!");
while (false !== ($file = readdir($dir_handle))) {
echo "<a href=\"$file\">$file</a><br />";
}
closedir($dir_handle);
?>
Todd
Sincerely,<?
$dir_handle = @opendir("./") or die("Unable to open directory!");
while (false !== ($file = readdir($dir_handle))) {
echo "<a href=\"$file\">$file</a><br />";
}
closedir($dir_handle);
?>
Code: Select all
<?
$files=array();
$dir_handle = @opendir("./") or die("Unable to open directory!");
while (false !== ($file = readdir($dir_handle))) {
array_push($files,$file);
}
closedir($dir_handle);
asort($files);
foreach ($files as $file){
echo "<a href=\"$file\">$file</a><br />";
}
?>
Code: Select all
<?
$files=array();
$dir_handle = @opendir("./") or die("Unable to open directory!");
while (false !== ($file = readdir($dir_handle))) {
if ($file != "index.php"){
array_push($files,$file);
}
}
closedir($dir_handle);
asort($files);
foreach ($files as $file){
echo "<a href=\"$file\">$file</a><br />";
}
?>
I am familiar with html but am just starting w/ php.<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
<title>http://www.toddrichardson.com/archive/</title>
</head>
<body>
<div style="margin-left: 40px;">
<span style="font-size: 12pt; font-family: Helvetica,Arial,sans-serif; color: rgb(102, 102, 102);">
<br>
<?
$files=array();
$dir_handle = @opendir("./") or die("Unable to open directory...");
while (false !== ($file = readdir($dir_handle))) {
if ($file != "index.php" && $file != "." && $file != "..") {
array_push($files,$file);
}
}
closedir($dir_handle);
asort($files);
foreach ($files as $file) {
echo "<a href=\"$file\">$file</a><br><br />";
}
?>
</span>
</div>
</body>
</html>
Code: Select all
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
<title>http://www.toddrichardson.com/archive/</title>
</head>
<body>
<div style="margin-left: 40px;">
<span style="font-size: 12pt; font-family: Helvetica,Arial,sans-serif; color: rgb(102, 102, 102);">
<br>
<?
$files=array();
$dir_handle = @opendir("./") or die("Unable to open directory...");
while (false !== ($file = readdir($dir_handle))) {
if ($file != "index.php" && $file != "." && $file != "..") {
array_push($files,$file);
}
}
closedir($dir_handle);
asort($files);
print "<table border=0 cellspacing=2 cellpadding=0>";
foreach ($files as $file) {
print "<tr><td><a href=\"$file\">$file</a>";
$status=stat("$file");
$filesize = $status[7];
$timestamp=date("l, d.m.y, H:i",$status[9]);
$timestamp=preg_replace( "/^[^,]*,/" , "" , $timestamp);
print "</td><td> <font color=\"#66FF66\">$filesize</font> </td><td> $timestamp</td></tr>\n";
}
print "</table>";
?>
</span>
</div>
</body>
</html>
Yes, Todd, that site abounds with examples of PHP scripts. Just try to think about the job you want and do a function search - it will give you a listing of the nearest useful functions.A good help for me were code-snippets from the function-list of http://php.net/