Page 1 of 1

Help - modify code to include all files

Posted: Wed Jun 29, 2005 7:43 am
by phpnewbdude
Is there a way to modify this script to include all .htm files instead of individually calling them? please help! I'm new to php and have no clue what i'm doing....

Code: Select all

<?php

$dir = "./";

// searching of filetypes
$filetypes = Array( "php","htm" );

// the title
// [pagename] => [name]
$titles = Array( "index.php"=>"startsidan", "heja.php"=>"hejsidan" );

$foundtype = "";

if ( is_dir($dir) ) {
if ( $dh = opendir($dir) ) {

$filenames = Array();

while ( ($file = readdir($dh) ) != false) {
$foundtype = explode(".",$file);
if ( ($file != "." && $file != ".." && $file[0] != '.') && array_key_exists($file, $titles)) {
$filenames[] = $file;
}
}
closedir($dh);
}
}

rsort($filenames);

$maxnum = 10;
$count = count( $filenames );
if ( $count > 10 )
$count = $maxnum;

if ( $count > 0 ) {
echo "$count recent updated pages:<p>";
for ($i = 0; $i < $count; $i++) {
// namn som visas om inte filen finns med i listan
$tmp = "Untitled";
if ( array_key_exists($filenames[$i], $titles) ) {
$tmp = $titles[$filenames[$i]];
}
echo ($i+1).". <a href=\"$filenames[$i]\">".$tmp."</a> ( ".date("Y-m-d H:i:s", filemtime($filenames[$i]))." )<br>";
}
echo "</p>";
}
else {
echo "<p>Didn't found any webpages.</p>";
}
?>

Posted: Sat Jul 02, 2005 8:33 pm
by Sphen001
Hi,

Try using a loop. Maybe something like this?

Code: Select all

foreach($filenames as $file)
{
  include($file);
}
Just make sure to get the directory names correct.

Hope this helps :D

Sphen001

Posted: Tue Jul 05, 2005 7:04 am
by phpnewbdude
Thank you for your reply, but I have no clue where to put this in the script... or how to modify it just for htm files. Can you help?

Re: Help - modify code to include all files

Posted: Wed Jul 06, 2005 8:24 pm
by Sphen001

Code: Select all

<?php

$dir = "./";

// searching of filetypes
$filetypes = Array( "php","htm" );

// the title
// [pagename] => [name]
$titles = Array( "index.php"=>"startsidan", "heja.php"=>"hejsidan" );

$foundtype = "";

if ( is_dir($dir) ) {
if ( $dh = opendir($dir) ) {

$filenames = Array();

while ( ($file = readdir($dh) ) != false) {
$foundtype = explode(".",$file);
if ( ($file != "." && $file != ".." && $file[0] != '.') && array_key_exists($file, $titles)) {
$filenames[] = $file;
}
}
closedir($dh);
}
}

foreach($filenames as $files)
{
  include $file;
}

//
// What is all this stuff for?
//

$maxnum = 10;
$count = count( $filenames );
if ( $count > 10 )
$count = $maxnum;

if ( $count > 0 ) {
echo "$count recent updated pages:<p>";
for ($i = 0; $i < $count; $i++) {
// namn som visas om inte filen finns med i listan
$tmp = "Untitled";
if ( array_key_exists($filenames[$i], $titles) ) {
$tmp = $titles[$filenames[$i]];
}
echo ($i+1).". <a href=\"$filenames[$i]\">".$tmp."</a> ( ".date("Y-m-d H:i:s", filemtime($filenames[$i]))." )<br>";
}
echo "</p&amp111;pagename] => [name]
$titles = Array( "index.php"=>"startsidan", "heja.php"=>"hejsidan" );

$foundtype = "";

if ( is_dir($dir) ) {
if ( $dh = opendir($dir) ) {

$filenames = Array();

while ( ($file = readdir($dh) ) != false) {
$foundtype = explode(".",$file);
if ( ($file != "." && $file != ".." && $file[0] != '.') && array_key_exists($file, $titles)) {
$filenames[] = $file;
}
}
closedir($dh);
}
}

foreach($filenames as $files)
{
  include $file;
}

//
// What is all this stuff for?
//

$maxnum = 10;
$count = count( $filenames );
if ( $count > 10 )
$count = $maxnum;

if ( $count > 0 ) {
echo "$count recent updated pages:<p>";
for ($i = 0; $i < $count; $i++) {
// namn som visas om inte filen finns med i listan
$tmp = "Untitled";
if ( array_key_exists($filenames[$i], $titles) ) {
$tmp = $titles[$filenames[$i]];
}
echo ($i+1).". <a href=\"$filenames[$i]\">".$tmp."</a> ( ".date("Y-m-d H:i:s", filemtime($filenames[$i]))." )<br>";
}
echo "</p>";
}
else {
echo "<p>Didn't found any webpages.</p>";
}
?>
Hope;0] != '.') && array_key_exists($file, $titles)) {
$filenames[] = $file;
}
}
closedir($dh);
}
}

foreach($filenames as $files)
{
include $file;
}

//
// What is all this stuff for?
//

$maxnum = 10;
$count = count( $filenames );
if ( $count > 10 )
$count = $maxnum;

if ( $count > 0 ) {
echo "$count recent updated pages:<p>";
for ($i = 0; $i < /";

// searching of filetypes
$filetypes = Array( "php","htm" );

// the title
// [pagename] => [name]
$titles = Array( "index.php"=>"startsidan", "heja.php"=>"hejsidan" );

$foundtype = "";

if ( is_dir($dir) ) {
if ( $dh = opendir($dir) ) {

$filenames = Array();

while ( ($file = readdir($dh) ) != false) {
$foundtype = explode(".&quote;,$file);
if ( ($file != &quote;.&quote; &amp;&amp; $file != &quote;..&quote; &amp;&amp; $fileї0] != '.') &amp;&amp; array_key_exists($file, $titles)) {
$filenamesї] = $file;
}
}
closedir($dh);
}
}

foreach($filenames as $files)
{
include $file;
}

//
// What is all this stuff for?
//

$maxnum = 10;
$count = count( $filenames );
if ( $count &gt; 10 )
$count = $maxnum;

if ( $count &gt; 0 ) {
echo &quote;$count recent updated pages:&lt;p&gt;&quote;;
for ($i = 0; $i &lt; $count; $i++) {
// namn som visas om inte filen finns med i listan
$tmp = &quote;Untitled&quote;;
if ( array_key_exists($filenamesї$i], $titles) ) {
$tmp = $titlesї$filenamesї$i]];
}
echo ($i+1).&quote;. &lt;a href=\&quote;$filenamep;quote;htm" );

// the title
// [pagename] =&gt; їname]
$titles = Array( &quote;index.php&quote;=&gt;&quote;startsidan&quote;, &quote;heja.php&quote;=&gt;&quote;hejsidan&quote; );

$foundtype = &quote;&quote;;

if ( is_dir($dir) ) {
if ( $dh = opendir($dir) ) {

$filenames = Array();

while ( ($file = readdir($dh) ) != false) {
$foundtype = explode(&quote;.&quote;,$file);
if ( ($file != &quote;.&quote; &amp;&amp; $file != &quote;..&quote; &amp;&amp; $fileї0] != '.') &amp;&amp; array_key_exists($file, $titles)) {
$filenamesї] = $file;
}
}
closedir($dh);
}
}

foreach($filenames as $files)
{
include $file;
}

//
// What is all this stuff for?
//

$maxnum = 10;
$count = count( $filenames );
if ( $count &gt; 10 )
$count = $maxnum;

if ( $count &gt; 0 ) {
echo &quote;$count recent updated pages:&lt;p&gt;&quote;;
for ($i = 0; $i &lt; $count; $i++) {
// namn som visas om inte filen finns med i listan
$tmp = &quote;Untitled&quote;;
if ( array_key_exists($filenamesї$i], $titles) ) {
$tmp = $titlesї$filenamesї$i]];
}
echo ($i+1).&quote;. &lt;a href=\&quote;$filenamesї$i]\&quote;&gt;&quote;.$tmp.&quote;&lt;/a&gt; ( &quote;.date(&quote;Y-m-d H:i:s&quote;, filemtime($filenamesї$i])).&quote; )&lt;br&gt;&quote;;
}
echo &quote;&lt;/p&gt;&quote;;
}
else {
echo &q;./";

// searching of filetypes
$filetypes = Array( "php","htm" );

// the title
// [pagename] => [name]
$titles = Array( "index.php"=>"startsidan", "heja.php"=>"hejsidan" );

$foundtype = "";

if ( is_dir($dir) ) {
if ( $dh = opendir($dir) ) {

$filenames = Array();

while ( ($file = readdir($dh) ) != false) {
$foundtype = explode(".",$file);
if ( ($file != "." && $file != ".." && $file[0] != '.') && array_key_exists($file, $titles)) {
$filenames[] = $file;
}
}
closedir($dh);
}
}

foreach($filenames as $files)
{
include $file;
}

//
// What is all this stuff for?
//

$maxnum = 10;
$count = count( $filenames );
if ( $count > 10 )
$count = $maxnum;

if ( $count > 0 ) {
echo "$count recent updated pages:<p>";
for ($i = 0; $i < $count; $i++) {
// namn som visas om inte filen finns med i listan
$tmp = "Untitled";
if ( array_key_exists($filenames[$i], $titles) ) {
$tmp = $titles[$filenames[$i]];
}
echo ($i+1).". <a href=\"$filenames[$i]\">".$tmp."</a> ( ".date("Y-m-d H:i:s", filemtime($filenames[$i]))." )<br>";
}
echo "&am
while ( ($file = readdir($dh) ) != false) {
$foundtype = explode(".",$file);
if ( ($file != "." && $file != ".." && $file[0] != '.') && array_key_exists($file, $titles)) {
$filenames[] = $file;
}
}
closedir($dh);
}
}

foreach($filenames as $files)
{
include $file;
}

//
// What is all this stuff for?
//

$maxnum = 10;
$count = count( $filenames );
if ( $count > 10 )
$count = $maxnum;

if ( $count > 0 ) {
echo "$count recent updated pages:<p>";
for ($i = 0; $i < $count; $i++) {
// namn som visas om inte filen finns med i listan
$tmp = "Untitled";
if ( array_key_exists($filenames[$i], $titles) ) {
$tmp = $titlenames = Array();

while ( ($file = readdir($dh) ) != false) {
$foundtype = explode(".",$file);
if ( ($file != "." && $file != ".." && $file[0] != '.') && array_key_exists($file, $titles)) {
$filenames[] = $file;
}
}
closedir($dh);
}
}

foreach($filenames as $files)
{
include $file;
}

//
// What is all this stuff for?
//

$maxnum = 10;
$count = count( $filenames );
if ( $count > 10 )
$count = $maxnum;

if ( $count > 0 ) {
echo "$count recent updated pages:<p>";
for ($i = 0; $i < $count; $i++) {
// namn som visas om inte filen finns med i listan
$tmp = "Untitled";
if ( array_key_exists($filenames[$i], $titles) ) {
$tmp = $titles[$filenames[$i]];
}
echo ($i+1).". <a href=\"$filenames[$i]\">".$tmp."</a> ( ".date("Y-m-d H:i:s", filemtime($filenames[$i]))." )<br>";
}
echo "</p>";
}
else {
echo "<p>Didn't found any webpages.</p>";
}
?>


Hope this works.te;php","htm" );

// the title
// [pagename] => [name]
$titles = Array( "index.php"=&gt;&quote;startsidan&quote;, &quote;heja.php&quote;=&gt;&quote;hejsidan&quote; );

$foundtype = &quote;&quote;;

if ( is_dir($dir) ) {
if ( $dh = opendir($dir) ) {

$filenames = Array();

while ( ($file = readdir($dh) ) != false) {
$foundtype = explode(&quote;.&quote;,$file);
if ( ($file != &quote;.&quote; &amp;&amp; $file != &quote;..&quote; &amp;&amp; $fileї0] != '.') &amp;&amp; array_key_exists($file, $titles)) {
$filenamesї] = $file;
}
}
closedir($dh);
}
}

foreach($filenames as $files)
{
include $file;
}

//
// What is all this stuff for?
//

$maxnum = 10;
$count = count( $filenames );
if ( $count &gt; 10 )
$count = $maxnum;

if ( $count &gt; 0 ) {
echo &quote;$count recent updated pages:&lt;p&gt;&quote;;
for ($i = 0; $i &lt; $count; $i++) {
// namn som visas om inte filen finns med i listan
$tmp = &quote;Untitled&quote;;
if ( array_key_exists($filenamesї$i], $titles) ) {
$tmp = $titlesї$filenamesї$i]];
}
echo ($i+1).&quote;. &lt;a href=\&quote;$filenamesї$i]\&quote;&gt;&quote;.$tmp.&quote;&lt;/a&gt; ( &quote;.date(&quote;Y-m-d H:i:s&quote;, filemtime($filenamesї$i])).&quote; )&lt;br&gt;&quote;;
}
echo &quote;&lt;/p&gt;&quote;;
}
else {
echo &amquote;,"htm" );

// the title
// [pagename] => [name]
$titles = Array( "index.php"=>&quote;startsidan&quote;, &quote;heja.php&quote;=&gt;&quote;hejsidan&quote; );

$foundtype = &quote;&quote;;

if ( is_dir($dir) ) {
if ( $dh = opendir($dir) ) {

$filenames = Array();

while ( ($file = readdir($dh) ) != false) {
$foundtype = explode(&quote;.&quote;,$file);
if ( ($file != &quote;.&quote; &amp;&amp; $file != &quote;..&quote; &amp;&amp; $fileї0] != '.') &amp;&amp; array_key_exists($file, $titles)) {
$filenamesї] = $file;
}
}
closedir($dh);
}
}

foreach($filenames as $files)
{
include $file;
}

//
// What is all this stuff for?
//

$maxnum = 10;
$count = count( $filenames );
if ( $count &gt; 10 )
$count = $maxnum;

if ( $count &gt; 0 ) {
echo &quote;$count recent updated pages:&lt;p&gt;&quote;;
for ($i = 0; $i &lt; $count; $i++) {
// namn som visas om inte filen finns med i listan
$tmp = &quote;Untitled&quote;;
if ( array_key_exists($filenamesї$i], $titles) ) {
$tmp = $titlesї$filenamesї$i]];
}
echo ($i+1).&quote;. &lt;a href=\&quote;$filenamesї$i]\&quote;&gt;&quote;.$tmp.&quote;&lt;/a&gt; ( &quote;.date(&quote;Y-m-d H:i:s&quote;, filemtime($filenamesї$i])).
<?php

$dir = "./";

// searching of filetypes
$filetypes = Array( "php","htm" );

// the title
// [pagename] => [name]
$titles = Array( "index.php"=>"startsidan", "heja.php"=>"hejsidan" );

$foundtype = "";

if ( is_dir($dir) ) {
if ( $dh = opendir($dir) ) {

$filenames = Array();

while ( ($file = readdir($dh) ) != false) {
$foundtype = explode(&quote;.&quote;,$file);
if ( ($file != &quote;.&quote; &amp;&amp; $file != &quote;..&quote; &amp;&amp; $fileї0] != '.') &amp;&amp; array_key_exists($file, $titles)) {
$filenamesї] = $file;
}
}
closedir($dh);
}
}

foreach($filenames as $files)
{
include $file;
}

//
// What is all this stuff for?
//

$maxnum = 10;
$count = count( $filenames );
if ( $count &gt; 10 )
$count = $maxnum;

if ( $count &gt; 0 ) {
echo &quote;$count recent updated pages:&lt;p&gt;&quote;;
for ($i = 0; $i &lt; $count; $i++) {
// namn som visas om inte filen finns med i listan
$tmp = &quote;Untitled&quote;;
if ( array_key_exists($filenamesї$i], $titles) ) {
$tmp = $titlesї$filenamesї$p

$dir = "./";

// searching of filetypes
$filetypes = Array( &quote;php&quote;,&quote;htm&quote; );

// the title
// їpagename] =&gt; їname]
$titles = Array( &quote;index.php"=>"startsidan", "heja.php"=>"hejsidan" );

$foundtype = "";

if ( is_dir($dir) ) {
if ( $dh = opendir($dir) ) {

$filenames = Array();

while ( ($file = readdir($dh) ) != false) {
$foundtype = explode(&quote;.&quote;,$file);
if ( ($file != &quote;.&quote; &amp;&amp; $file != &quote;..&quote; &amp;&amp; $fileї0] != '.') &amp;&amp; array_key_exists($file, $titles)) {
$filenamesї] = $file;
}
}
closedir($dh);
}
}

foreach($filenames as $files)
{
include $file;
}

//
// What is all this stuff for?
//

$maxnum = 10;
$count = count( $filenames );
if ( $count &gt; 10 )
$count = $maxnum;

if ( $count &gt; 0 ) {
echo &quote;$count recent updated pages:&lt;p&gt;&quote;;
for ($i = 0; $i &lt; $count; $i++) {
// namn som visas om inte filen finns med i listan
$tmp = &quote;Untitled&quote;;
if ( array_key_exists($filenamesї$i], $titles) ) {
$tmp = $titlesї$filenamesї$i]];
}
echo ($i+1).&quote;. &lt;a href=\&quote;$filenamesї$i]\&quote;&gt;&quote;.$tmp.&quote;&lt;/a&gt; ( &quote;.date(&quote;Y-m-d H:i:s&quote;, filemtime($filenamesї$i])).&quote; )&lt;br&gt;&quote;;
}
ray( "index.php"=>"startsidan", "heja.php"=>"hejsidan" );

$foundtype = "";

if ( is_dir($dir) ) {
if ( $dh = opendir($dir) ) {

$filenames = Array();

while ( ($file = readdir($dh) ) != false) {
$foundtype = explode(&quote;.&quote;,$file);
if ( ($file != &quote;.&quote; &amp;&amp; $file != &quote;..&quote; &amp;&amp; $fileї0] != '.') &amp;&amp; array_key_exists($file, $titles)) {
$filenamesї] = $file;
}
}
closedir($dh);
}
}

foreach($filenames as $files)
{
include $file;
}

//
// What is all this stuff for?
//

$maxnum = 10;
$count = count( $filenames );
if ( $count &gt; 10 )
$count = $maxnum;

if ( $count &gt; 0 ) {
echo &quote;$count recent updated pages:&lt;p&gt;&quote;;
for ($i = 0; $i &lt; $count; $i++) {
// namn som visas om inte filen finns med i listan
$tmp = &quote;Untitled&quote;;
if ( array_key_exists($filenamesї$i], $titles) ) {
$tmp = $titlesї$filenamesї$i]];
}
echo ($i+1).&quote;. &lt;a href=\&quote;$filenamesї$i]\&quote;&gt;&quote;.$tmp.&quote;&lt;/a&gt; ( &quote;.date(&quote;Y-m-d H:i:s&quote;, filemtime($filenamesї$i])).&quote; )&amamp;gt; [name]
$titles = Array( "index.php"=>"startsidan", "heja.php"=>"hejsidan" );

$foundtype = "";

if ( is_dir($dir) ) {
if ( $dh = opendir($dir) ) {

$filenames = Array();

while ( ($file = readdir($dh) ) != false) {
$foundtype = explode(".",$file);
if ( ($file != "." && $file != ".." && $file[0] != '.') && array_key_exists($file, $titles)) {
$filenames[] = $file;
}
}
closedir($dh);
}
}

foreach($filenames as $files)
{
include $file;
}

//
// What is all this stuff for?
//

$maxnum = 10;
$count = count( $filenames );
if ( $count &gt; 10 )
$count = $maxnum;

if ( $count &gt; 0 ) {
echo &quote;$count recent updat
// searching of filetypes
$filetypes = Array( "php","htm" );

// the title
// [pagename] => [name]
$titles = Array( "index.php"=>"startsidan", "heja.php"=>"hejsidan" );

$foundtype = "";

if ( is_dir($dir) ) {
if ( $dh = opendir($dir) ) {

$filenames = Array();

while ( ($file = readdir($dh) ) != false) {
$foundtype = explode(".",$file);
if ( ($file != "." && $file != ".." && $file[0] != '.') && array_key_exists($file, $titles)) {
$filenames[] = $file;
}
}
closedir($dh);
}
}

foreach($filenames as $files)
{
include $file;
}

//
// What is all this stuff for?
//

$maxnum = 10;
$count = count( $filenames );
if ( $count > 10 )
$count = $maxnum;

if ( $count > 0 ) {
echo "$count recent updated pages:<p>";
for ($i = 0; $i < $count; $i++) {
// namn som visas om inte filen finns med i listan
$tmp = "Untitled";
if ( array_key_exists($filenames[$i], $titles) ) {
$tmp = $titles[$filenames[$i]];
}
echo ($i+1).". <a href=\"$filenames[$i]\">".$tmp."</a> ( ".date("Y-m-d H:i:s", filemtime($filenames[$i]))." )<br>";
}
echo "</p>";
}
else {
echo "<p>Didn't found any webpages.</p>";
}
?>


Hope this works.quote;index.php"=>"startsidan", "heja.php"=>"hejsidan" );

$foundtype = "";

if ( is_dir($dir) ) {
if ( $dh = opendir($dir) ) {

$filenames = Array();

while ( ($file = readdir($dh) ) != false) {
$foundtype = explode(&quote;.&quote;,$file);
if ( ($file != &quote;.&quote; &amp;&amp; $file != &quote;..&quote; &amp;&amp; $fileї0] != '.') &amp;&amp; array_key_exists($file, $titles)) {
$filenamesї] = $file;
}
}
closedir($dh);
}
}

foreach($filenames as $files)
{
include $file;
}

//
// What is all this stuff for?
//

$maxnum = 10;
$count = count( $filenames );
if ( $count &gt; 10 )
$count = $maxnum;

if ( $count &gt; 0 ) {
echo &quote;$count recent updated pages:&lt;p&gt;&quote;;
for ($i = 0; $i &lt; $count; $i++) {
// namn som visas om inte filen finns med i listan
$tmp = &quote;Untitled&quote;;
if ( array_key_exists($filenamesї$i], $titles) ) {
$tmp = $titlesї$filenamesї$i]];
}
echo ($i+1).&quote;. &lt;a href=\&quote;$filenamesї$i]\&quote;&am$filetypes = Array( "php","htm" );

// the title
// [pagename] => [name]
$titles = Array( &quote;index.php&quote;=&gt;&quote;startsidan&quote;, &quote;heja.php&quote;=&gt;&quote;hejsidan&quote; );

$foundtype = &quote;&quote;;

if ( is_dir($dir) ) {
if ( $dh = opendir($dir) ) {

$filenames = Array();

while ( ($file = readdir($dh) ) != false) {
$foundtype = explode(&quote;.&quote;,$file);
if ( ($file != &quote;.&quote; &amp;&amp; $file != &quote;..&quote; &amp;&amp; $fileї0] != '.') &amp;&amp; array_key_exists($file, $titles)) {
$filenamesї] = $file;
}
}
closedir($dh);
}
}

foreach($filenames as $files)
{
include $file;
}

//
// What is all this stuff for?
//

$maxnum = 10;
$count = count( $filenames );
if ( $count &gt; 10 )
$count = $maxnum;

if ( $count &gt; 0 ) {
echo &quote;$count recent updated pages:&lt;p&gt;&quote;;
for ($i = 0; $i &lt; $count; $i++) {
// namn som visas om inte filen finns med i listan
$tmp = &quote;Untitled&quote;;
if ( array_key_exists($filenamesї$i], $titles) ) {
$tmp = $titlesї$filenamesї$i]];
}
echo ($i+1).&quote;. &lt;a href=\&quote;$filenamesї$i]\&quote;&gt;&quote;.$tmp.&quote;&lt;/a&gt; ( &quote;.date(&quote;Y-m-d H:i:s&quote;, filemtime($filenamesї$i])).&quote; )&lt;br&gt;&quote;;
}
echo &amp
<?php

$dir = "./";

// searching of filetypes
$filetypes = Array( "php",&quote;htm&quote; );

// the title
// їpagename] =&gt; їname]
$titles = Array( &quote;index.php&quote;=&gt;"startsidan", "heja.php"=>"hejsidan" );

$foundtype = "";

if ( is_dir($dir) ) {
if ( $dh = opendir($dir) ) {

$filenames = Array();

while ( ($file = readdir($dh) ) != false) {
$foundtype = explode(".",$file);
if ( ($file != "." && $file != ".." && $file[0] != '.') && array_key_exists($file, $titles)) {
$filenames[] = $file;
}
}
closedir($dh);
}
}

foreach($filenames as $files)
{
include $file;
}

//
// What is all this stuff for?
//

$maxnum = 10;
$count = count( $filenames );
if ( $count > 10 )
$count = $maxnum;

if ( $count > 0 ) {
echo "$count recent updated pages:<p>";
for ($i = 0; $i < $count; $i++) {
// namn som visas om inte filen finns med i listan
$tmp = "Untitled";
if ( array_key_exists($filenames[$i], $titles) ) {
$tmp = $t$dir = "./";

// searching of filetypes
$filetypes = Array( "php","htm" );

// the title
// [pagename] => [name]
$titles = Array( "index.php"=>"startsidan", "heja.php"=>"hejsidan" );

$foundtype = "";

if ( is_dir($dir) ) {
if ( $dh = opendir($dir) ) {

$filenames = Array();

while ( ($file = readdir($dh) ) != false) {
$foundtype = explode(".",$file);
if ( ($file != "." && $file != &quote;..&quote; &amp;&amp; $fileї0] != '.') &amp;&amp; array_key_exists($file, $titles)) {
$filenamesї] = $file;
}
}
closedir($dh);
}
}

foreach($filenames as $files)
{
include $file;
}

//
// What is all this stuff for?
//

$maxnum = 10;
$count = count( $filenames );
if ( $count &gt; 10 )
$count = $maxnum;

if ( $count &gt; 0 ) {
echo &quote;$count recent updated pages:&lt;p&gt;&quote;;
for ($i = 0; $i &lt; $count; $i++) {
// namn som visas om inte filen finns med i listan
$tmp = &quote;Untitled&quote;;
if ( array_key_exists($filenamesї$i], $titles) ) {
$tmp = $titlesї$filenamesї$i]];
}
echo ($i+1).&quote;. &lt;a href=\=> [name]
$titles = Array( "index.php"=&gt;&quote;startsidan", "heja.php"=>"hejsidan&quote; );

$foundtype = &quote;&quote;;

if ( is_dir($dir) ) {
if ( $dh = opendir($dir) ) {

$filenames = Array();

while ( ($file = readdir($dh) ) != false) {
$foundtype = explode(&quote;.&quote;,$file);
if ( ($file != &quote;.&quote; &amp;&amp; $file != &quote;..&quote; &amp;&amp; $fileї0] != '.') &amp;&amp; array_key_exists($file, $titles)) {
$filenamesї] = $file;
}
}
closedir($dh);
}
}

foreach($filenames as $files)
{
include $file;
}

//
// What is all this stuff for?
//

$maxnum = 10;
$count = count( $filenames );
if ( $count &gt; 10 )
$count = $maxnum;

if ( $count &gt; 0 ) {
echo &quote;$count recent updated pages:&lt;p&gt;&quote;;
for ($i = 0; $i &lt; $count; $i++) {
// namn som visas om inte filen finns med i listan
$tmp = &quote;Untitled&quote;;
if ( array_key_exists($filenamesї$i], $titles) ) {
$tmp = $titlesї$filenamesї$i]];
}
echo ($i+1).&quote;. &lt;a href=\&quote;$filenamesї$i]\&quote;&gt;&amp "./";

// searching of filetypes
$filetypes = Array( "php","htm" );

// the title
// [pagename] => [name]
$titles = Array( "index.php"=>"startsidan", "heja.php"=>"hejsidan" );

$foundtype = "";

if ( is_dir($dir) ) {
if ( $dh = opendir($dir) ) {

$filenames = Array();

while ( ($file = readdir($dh) ) != false) {
$foundtype = explode(".",$file);
if ( ($file != "." && $file != ".." && $file[0] != '.') && array_key_exists($file, $titles)) {
$filenames[] = $file;
}
}
closedir($dh);
}
}

foreach($filenames as $files)
{
include $file;
}

//
// What is all this stuff for?
//

$maxnum = 10;
$count = count( $filenames );
if ( $count > 10 )
$count = $maxnum;

if ( $count > 0 ) {
echo "$count recent updated pages:<p>";
for ($i = 0; $i < $count; $i++) {
// namn som visasuote;, "heja.php"=>"hejsidan" );

$foundtype = "";

if ( is_dir($dir) ) {
if ( $dh = opendir($dir) ) {

$filenames = Array();

while ( ($file = readdir($dh) ) != false) {
$foundtype = explode(".",$file);
if ( ($file != "." && $file != ".." && $file[0] != '.') && array_key_exists($file, $titles)) {
$filenames[] = $file;
}
}
closedir($dh);
}
}

foreach($filenames as $files)
{
include $file;
}

//
// What is all this stuff for?
//

$maxnum = 10;
$count = count( $filenames );
if ( $count > 10 )
$count = $maxnum;

if ( $count > 0 ) {
echo "$count recent updated pages:<p>";
for ($i = 0; $i < $count; $i++) {
// namn som visas om inte filen finns med i listan
$tmp = "Untitled";
if ( array_key_exists($filenames[$i], $titles) ) {
$tmp = $titles[$filenames[$i]];
}
echo ($i+1).". <a href=\"$filenames[$i]\">".$tmp."</a> ( ".date("Y-m-d H:i:s", filemtime($filenames[$i]))." )<br>";
}
echo "</p>";
}
else {
echo "<p>Didn't found any webpages.</p>";
}
?>


Hope this works.ote;;

// searching of filetypes
$filetypes = Array( "php","htm" );

// the title
// [pagename] => [name]
$titles = Array( "index.php"=>"startsidan", "heja.php&quote;=&gt;&quote;hejsidan&quote; );

$foundtype = &quote;&quote;;

if ( is_dir($dir) ) {
if ( $dh = opendir($dir) ) {

$filenames = Array();

while ( ($file = readdir($dh) ) != false) {
$foundtype = explode(&quote;.&quote;,$file);
if ( ($file != &quote;.&quote; &amp;&amp; $file != &quote;..&quote; &amp;&amp; $fileї0] != '.') &amp;&amp; array_key_exists($file, $titles)) {
$filenamesї] = $file;
}
}
closedir($dh);
}
}

foreach($filenames as $files)
{
include $file;
}

//
// What is all this stuff for?
//

$maxnum = 10;
$count = count( $filenames );
if ( $count &gt; 10 )
$count = $maxnum;

if ( $count &gt; 0 ) {
echo &quote;$count recent updated pages:&lt;p&gt;&quote;;
for ($i = 0; $i &lt; $count; $i++) {
// namn som visas om inte filen finns med i listan
$tmp = &quote;Untitled&quote;;
if ( array_key_exists($filenamesї$i], $titles) ) {
$tmp = $titlesї$filenamesї$i]];
}
echo ($i+1).&quote;. &lt;a href=\&quote;$filenamesї$i]\&quote;&gt;&quote;.$tmp.&quote;&lt;/a&gt; ( &quote;.date(&quote;Y-m-d H:i:s&quote;, filemtime($filenamesї$i])).&quote; )&lt;br&gt;&quote;;
}
echop;quote;php","htm" );

// the title
// [pagename] => [name]
$titles = Array( "index.php"=>"startsidan", "heja.php&quote;=&gt;&quote;hejsidan&quote; );

$foundtype = "";

if ( is_dir($dir) ) {
if ( $dh = opendir($dir) ) {

$filenames = Array();

while ( ($file = readdir($dh) ) != false) {
$foundtype = explode(".",$file);
if ( ($file != "." && $file != ".." && $file[0] != '.') && array_key_exists($file, $titles)) {
$filenames[] = $file;
}
}
closedir($dh);
}
}

foreach($filenames as $files)
{
include $file;
}

//
// What is all this stuff for?
//

$maxnum = 10;
$count = count( $filenames );
if ( $count > 10 )
$count = $maxnum;

if ( $count > 0 ) {
echo "$count recent updated pages:<p>";
for ($i = 0; $i < $count; $i++) {
// namn som visas om inte filen finns med i listan
$tmp = "Untitled";
if ( array_key_exists($filenames[$i], $titles) ) {
$tmp = $titles[$filenames[$i]];
}
echo ($i+1).". <a href=\"$filenames[$i]\">".$tmp."</a> ( ".date("Y-m-d H:i:s", filemtime($filenames[$i]))." )<br>";
}
echo "</p>";
}
else {
echo "<p>Didn't found any webpages.</p>";
}
?>


Hope this works.
<?php

$dir = "./";

// searching of filetypes
$filetypes = Array( "php&quote;,&quote;htm&quote; );

// the title
// їpagename] =&gt; їname]
$titles = Array( &quote;index.php&quote;=&gt;&quote;startsidan&quote;, &quote;heja.php&quote;=&gt;&quote;hejsidan&quote; );

$foundtype = &quote;&quote;;

if ( is_dir($dir) ) {
if ( $dh = opendir($dir) ) {

$filenames = Array();

while ( ($file = readdir($dh) ) != false) {
$foundtype = explode(&quote;.&quote;,$file);
if ( ($file != &quote;.&quote; &amp;&amp; $file != &quote;..&quote; &amp;&amp; $fileї0] != '.') &amp;&amp; array_key_exists($file, $titles)) {
$filenamesї] = $file;
}
}
closedir($dh);
}
}

foreach($filenames as $files)
{
include $file;
}

//
// What is all this stuff for?
//

$maxnum = 10;
$count = count( $filenames );
if ( $count &gt; 10 )
$count = $maxnum;

if ( $count &gt; 0 ) {
echo &quote;$count recent updated pages:&lt;p&gt;&quote;;
for ($i = 0; $i &lt; $count; $i++) {
// namn som visas om inte filen finns med i listan
$tmp = &quote;Untitled&quote;;
if ( array_key_exists($filenamesї$i], $titles) ) {
$tmp = $titlesї$filenamesї$i]];
}
echo ($i+1).&quote;. &lt;a href=\&quote;$filenamesї$i]\&quote;&gt;&quote;.$tmp.&quote;&lt;/a&gt; ( &quote;.date(&quote;Y-m-d H:i:s&quote;, filemtime($filenamesї$i])).&quote; )&lt;br&gt;&quote;;
}
echo &quote;&lt;/p&gt;&quote;;
}
else {
echo &quote;&lt;p&gt;Didn't found any webpages.&lt;/p&gt;&quote;;
}
?&gtes
$filetypes = Array( "php","htm" );

// the title
// [pagename] => [name]
$titles = Array( "index.php"=>"startsidan", "heja.php"=&gt;&quote;hejsidan&quote; );

$foundtype = &quote;&quote;;

if ( is_dir($dir) ) {
if ( $dh = opendir($dir) ) {

$filenames = Array();

while ( ($file = readdir($dh) ) != false) {
$foundtype = explode(&quote;.&quote;,$file);
if ( ($file != &quote;.&quote; &amp;&amp; $file != &quote;..&quote; &amp;&amp; $fileї0] != '.') &amp;&amp; array_key_exists($file, $titles)) {
$filenamesї] = $file;
}
}
closedir($dh);
}
}

foreach($filenames as $files)
{
include $file;
}

//
// What is all this stuff for?
//

$maxnum = 10;
$count = count( $filenames );
if ( $count &gt; 10 )
$count = $maxnum;

if ( $count &gt; 0 ) {
echo &quote;$count recent updated pages:&lt;p&gt;&quote;;
for ($i = 0; $i &lt; $count; $i++) {
// namn som visas om inte filen finns med i listan
$tmp = &quote;Untitled&quote;;
if ( array_key_exists($filenamesї$i], $titles) ) {
$tmp = $titlesї$filenamesї$i]];
}
echo ($i+1).&quote;. &lt;a href=\&quote;$filenamesї$i]\&quote;&gt;&quote;.$tmp.&quote;&lt;/a&gt; ( &quote;.date(&quote;Y-m-d H:i:s&quote;, filemtime($filenamesї$i])).&quote; )&aetypes = Array( "php","htm" );

// the title
// [pagename] => [name]
$titles = Array( "index.php"=>"startsidan", &quote;heja.php&quote;=&gt;&quote;hejsidan&quote; );

$foundtype = &quote;&quote;;

if ( is_dir($dir) ) {
if ( $dh = opendir($dir) ) {

$filenames = Array();

while ( ($file = readdir($dh) ) != false) {
$foundtype = explode(&quote;.&quote;,$file);
if ( ($file != &quote;.&quote; &amp;&amp; $file != &quote;..&quote; &amp;&amp; $fileї0] != '.') &amp;&amp; array_key_exists($file, $titles)) {
$filenamesї] = $file;
}
}
closedir($dh);
}
}

foreach($filenames as $files)
{
include $file;
}

//
// What is all this stuff for?
//

$maxnum = 10;
$count = count( $filenames );
if ( $count &gt; 10 )
$count = $maxnum;

if ( $count &gt; 0 ) {
echo &quote;$count recent updated pages:&lt;p&gt;&quote;;
for ($i = 0; $i &lt; $count; $i++) {
// namn som visas om inte filen finns med i listan
$tmp = &quote;Untitled&quote;;
if ( array_key_exists($filenamesї$i], $titles) ) {
$tmp = $titlesї$filenamesї$i]];
}
echo ($i+1).&quote;. &lt;a href=\&quote;$filenamesї$i]\&quote;&gt;&quote;.$tmp.&quote;&lt;/a&gt; ( &quote;.date(&quote;Y-m-d H:i:s&quote;, filemtime($filenamesї$i])).&quote; )&lt;br&gt;&quote;;
}
echo &ampray( "php","htm" );

// the title
// [pagename] => [name]
$titles = Array( "index.php"=>"startsidan", "heja.php&quote;=&gt;&quote;hejsidan&quote; );

$foundtype = &quote;&quote;;

if ( is_dir($dir) ) {
if ( $dh = opendir($dir) ) {

$filenames = Array();

while ( ($file = readdir($dh) ) != false) {
$foundtype = explode(".",$file);
if ( ($file != "." && $file != ".." && $file[0] != '.') && array_key_exists($file, $titles)) {
$filenames[] = $file;
}
}
closedir($dh);
}
}

foreach($filenames as $files)
{
include $file;
}

//
// What is all this stuff for?
//

$maxnum = 10;
$count = count( $filenames );
if ( $count > 10 )
$count = $maxnum;

if ( $count >
<?php

$dir = "./";

// searching of filetypes
$filetypes = Array( "php","htm" );

// the title
// [pagename] => [name]
$titles = Array( "index.php"=>"startsidan", "heja.php"=>"hejsidan" );

$foundtype = "";

if ( is_dir($dir) ) {
if ( $dh = opendir($dir) ) {

$filenames = Array();

while ( ($file = readdir($dh) ) != false) {
$foundtype = explode(&quote;.&quote;,$file);
if ( ($file != &quote;.&quote; &amp;&amp; $file != &quote;..&quote; &amp;&amp; $fileї0] != '.') &amp;&amp; array_key_exists($file, $titles)) {
$filenames[] = $file;
}
}
closedir($dh);
}
}

foreach($filenames as $files)
{
include $file;
}

//
// What is all this stuff for?
//

$maxnum = 10;
$count = count( $filenames );
if ( $count &gt; 10 )
$count = $maxnum;

if ( $count > 0 ) {
echo "$count recent updated pages:<p>";
for ($i = 0; $i < $count; $i++) {
// namn som visas om inte filen finns med i listan
$tmp = "Untitled";
if ( array_key_exists($filenames[$i], $t
// searching of filetypes
$filetypes = Array( "php","htm" );

// the title
// [pagename] => [name]
$titles = Array( "index.php"=>"startsidan", "heja.php"=>"hejsidan&quote; );

$foundtype = &quote;&quote;;

if ( is_dir($dir) ) {
if ( $dh = opendir($dir) ) {

$filenames = Array();

while ( ($file = readdir($dh) ) != false) {
$foundtype = explode(&quote;.&quote;,$file);
if ( ($file != &quote;.&quote; &amp;&amp; $file != &quote;..&quote; &amp;&amp; $fileї0] != '.') &amp;&amp; array_key_exists($file, $titles)) {
$filenamesї] = $file;
}
}
closedir($dh);
}
}

foreach($filenames as $files)
{
include $file;
}

//
// What is all this stuff for?
//

$maxnum = 10;
$count = count( $filenames );
if ( $count &gt; 10 )
$count = $maxnum;

if ( $count &gt; 0 ) {
echo &quote;$count recent updated pages:&lt;p&gt;&quote;;
for ($i = 0; $i &lt; $count; $i++) {
// namn som visas om inte filen finns med i listan
$tmp = &quote;Untitled&quote;;
if ( array_key_exists($filenamesї$i], $titles) ) {
$tmp = $titlesї$filenamesї$i]];
}
echo ($i+1).&quote;. &lt;a href=\&quote;$filenamesї$i]\&quote;&gt;&quote;.$tmp.&quote;&lt;/a&amp
<?php

$dir = "./";

// searching of filetypes
$filetypes = Array( "php","htm" );

// the title
// [pagename] => [name]
$titles = Array( "index.php"=>&quote;startsidan&quote;, &quote;heja.php&quote;=&gt;&quote;hejsidan&quote; );

$foundtype = &quote;&quote;;

if ( is_dir($dir) ) {
if ( $dh = opendir($dir) ) {

$filenames = Array();

while ( ($file = readdir($dh) ) != false) {
$foundtype = explode(&quote;.&quote;,$file);
if ( ($file != &quote;.&quote; &amp;&amp; $file != &quote;..&quote; &amp;&amp; $fileї0] != '.') &amp;&amp; array_key_exists($file, $titles)) {
$filenamesї] = $file;
}
}
closedir($dh);
}
}

foreach($filenames as $files)
{
include $file;
}

//
// What is all this stuff for?
//

$maxnum = 10;
$count = count( $filenames );
if ( $count &gt; 10 )
$count = $maxnum;

if ( $count &gt; 0 ) {
echo &quote;$count recent updated pages:&lt;p&gt;&quote;;
for ($i = 0; $i &lt; $count; $i++) {
// namn som visas om inte filen finns med i listan
$tmp = &quote;Untitled&quote;;
if ( array_key_exists($filenamesї$i], $titles) ) {
$tmp = $titlesї$filenamesї$i]];
}
echo ($i+1).&quote;. &lt;a href=\&quote;$filenamesї$i]\&quote;&gt;&quote;.$tmp.&quote;&lt;/a&gt; ( &quote;.date(&quote;Y-m-d H:i:s&quote;, filemtime($filenamesї$i])).&quote; )&lt;br&gt;&quote;;
}
echo &quofiletypes
$filetypes = Array( "php","htm" );

// the title
// [pagename] => [name]
$titles = Array( "index.php"=&gt;&quote;startsidan&quote;, &quote;heja.php&quote;=&gt;&quote;hejsidan&quote; );

$foundtype = &quote;&quote;;

if ( is_dir($dir) ) {
if ( $dh = opendir($dir) ) {

$filenames = Array();

while ( ($file = readdir($dh) ) != false) {
$foundtype = explode(&quote;.&quote;,$file);
if ( ($file != &quote;.&quote; &amp;&amp; $file != &quote;..&quote; &amp;&amp; $fileї0] != '.') &amp;&amp; array_key_exists($file, $titles)) {
$filenamesї] = $file;
}
}
closedir($dh);
}
}

foreach($filenames as $files)
{
include $file;
}

//
// What is all this stuff for?
//

$maxnum = 10;
$count = count( $filenames );
if ( $count &gt; 10 )
$count = $maxnum;

if ( $count &gt; 0 ) {
echo &quote;$count recent updated pages:&lt;p&gt;&quote;;
for ($i = 0; $i &lt; $count; $i++) {
// namn som visas om inte filen finns med i listan
$tmp = &quote;Untitled&quote;;
if ( array_key_exists($filenamesї$i], $titles) ) {
$tmp = $titlesї$filenamesї$i]];
}
echo ($i+1).&quote;. &lt;a href=\&quote;$filenamesї$i]\&quote;&gt;&quote;.$tmp.&quote;&lt;/a&gt; ( &quote;.date(&quote;Y-m-d H:i:s&quote;, filemtime($filenamesї$i])).&quote; )&lt;br&g"./";

// searching of filetypes
$filetypes = Array( "php","htm" );

// the title
// [pagename] => [name]
$titles = Array( "index.php"=>"startsidan", "heja.php"=>"hejsidan" );

$foundtype = "";

if ( is_dir($dir) ) {
if ( $dh = opendir($dir) ) {

$filenames = Array();

while ( ($file = readdir($dh) ) != false) {
$foundtype = explode(".",$file);
if ( ($file != "." && $file != ".." && $file[0] != '.') && array_key_exists($file, $titles)) {
$filenames[] = $file;
}
}
closedir($dh);
}
}

foreach($filenames as $files)
{
include $file;
}

//
// What is all this stuff for?
//

$maxnum = 10;
$count = count( $filenames );
if ( $count > 10 )
$count = $maxnum;

if ( $count > 0 ) {
echo "$count recent updated pages:<p>";
for ($i = 0; $i < $count; $i++) {
// namn som visas om inte filen finns med i listan
$tmp = "Untitled";
if ( array_key_exists($filenames[$i], $titles) ) {
$tmp = $titles[$filenames[$i]];
}
echo ($i+1).". <a href=\"$filenames[$i]\">".$tmp."</a> ( ".date("Y-m-d H:i:s", filemtime($filenames[$i]))." )<br>";
}
echo "</p>";
}
else {
echo "<p>Didn't found any webpages.</p>";
}
?>


Hope this works.uote; );

$foundtype = "";

if ( is_dir($dir) ) {
if ( $dh = opendir($dir) ) {

$filenames = Array();

while ( ($file = readdir($dh) ) != false) {
$foundtype = explode(".",$file);
if ( ($file != "." && $file != ".." && $file[0] != '.') && array_key_exists($file, $titles)) {
$filenames[] = $file;
}
}
closedir($dh);
}
}

foreach($filenames as $files)
{
include $file;
}

//
// What is all this stuff for?
//

$maxnum = 10;
$count = count( $filenames );
if ( $count > 10 )
$count = $maxnum;

if ( $count > 0 ) {
echo "$count recent updated pages:<p>";
for ($i = 0; $i < $count; $i++) {
// namn som visas om inte filen finns med i listan
$tmp = "Untitled";
if ( array_key_exists($filenames[$i], $titles) ) {
$tmp = $titles[$filenames[$i]];
}
echo ($i+1).". <a href=\"$filenames[$i]\">".$tmp."</a> ( ".date("Y-m-d H:i:s", filemtime($filenames[$i]))." )<br>";
}
echo "</p>";
}
else {
echo "<p>Didn't found any webpages.</p>";
}
?>


Hope this works.;quote;, "heja.php"=>"hejsidan" );

$foundtype = "";

if ( is_dir($dir) ) {
if ( $dh = opendir($dir) ) {

$filenames = Array();

while ( ($file = readdir($dh) ) != false) {
$foundtype = explode(&quote;.&quote;,$file);
if ( ($file != &quote;.&quote; &amp;&amp; $file != &quote;..&quote; &amp;&amp; $fileї0] != '.') &amp;&amp; array_key_exists($file, $titles)) {
$filenamesї] = $file;
}
}
closedir($dh);
}
}

foreach($filenames as $files)
{
include $file;
}

//
// What is all this stuff for?
//

$maxnum = 10;
$count = count( $filenames );
if ( $count &gt; 10 )
$count = $maxnum;

if ( $count &gt; 0 ) {
echo &quote;$count recent updated pages:&lt;p&gt;&quote;;
for ($i = 0; $i &lt; $count; $i++) {
// namn som visas om inte filen finns med i listan
$tmp = &quote;Untitled&quote;;
if ( array_key_exists($filenamesї$i], $titles) ) {
$tmp = $titlesї$filenamesї$i]];
}
echo ($i+1).&quote;. /";

// searching of filetypes
$filetypes = Array( "php","htm" );

// the title
// [pagename] => [name]
$titles = Array( "index.php"=>"startsidan", "heja.php"=>&quote;hejsidan&quote; );

$foundtype = &quote;&quote;;

if ( is_dir($dir) ) {
if ( $dh = opendir($dir) ) {

$filenames = Array();

while ( ($file = readdir($dh) ) != false) {
$foundtype = explode(&quote;.&quote;,$file);
if ( ($file != &quote;.&quote; &amp;&amp; $file != &quote;..&quote; &amp;&amp; $fileї0] != '.') &amp;&amp; array_key_exists($file, $titles)) {
$filenamesї] = $file;
}
}
closedir($dh);
}
}

foreach($filenames as $files)
{
include $file;
}

//
// What is all this stuff for?
//

$maxnum = 10;
$count = count( $filenames );
if ( $count &gt; 10 )
$count = $maxnum;

if ( $count &gt; 0 ) {
echo &quote;$count recent updated pages:&lt;p&gt;&quote;;
for ($i = 0; $i &lt; $count; $i++) {
// namn som visas om inte filen finns med i listan
$tmp = &quote;Untitled&quote;;
if ( array_key_exists($filenamesї$i], $titles) ) {
$tmp = $titlesї$filenamesї$i]];
}
echo ($i+1).&quote;. &lt;a href=\&quote;$filenamesї$i]\&quote;&gt;&quote;.$tmp.&quote;&lt;/a&gt; ( &quote;.date(&quote;Y-m-d H:i:s&quote;, filemtime($ searching of filetypes
$filetypes = Array( "php","htm" );

// the title
// [pagename] =&gt; їname]
$titles = Array( &quote;index.php&quote;=&gt;&quote;startsidan&quote;, &quote;heja.php&quote;=&gt;&quote;hejsidan&quote; );

$foundtype = &quote;&quote;;

if ( is_dir($dir) ) {
if ( $dh = opendir($dir) ) {

$filenames = Array();

while ( ($file = readdir($dh) ) != false) {
$foundtype = explode(&quote;.&quote;,$file);
if ( ($file != &quote;.&quote; &amp;&amp; $file != &quote;..&quote; &amp;&amp; $fileї0] != '.') &amp;&amp; array_key_exists($file, $titles)) {
$filenamesї] = $file;
}
}
closedir($dh);
}
}

foreach($filenames as $files)
{
include $file;
}

//
// What is all this stuff for?
//

$maxnum = 10;
$count = count( $filenames );
if ( $count &gt; 10 )
$count = $maxnum;

if ( $count &gt; 0 ) {
echo &quote;$count recent updated pages:&lt;p&gt;&quote;;
for ($i = 0; $i &lt; $count; $i++) {
// namn som visas om inte filen finns med i listan
$tmp = &quote;Untitled&quote;;
if ( array_key_exists($filenamesї$i], $titles) ) {
$tmp = $titlesї$filenamesї$i]];
}
echo ($i+1).&quote;. &lt;a href=\&quote;$filenamesї$i]\&quote;&gt;&quote;.$tmp.&quote;&lt;/a&gt; ( &quote;.date(&quote;Y-m-d H:i:s&quote;, filemtime($filenamesї$i])).&quote; )&lt;br&gt;&quote;;
}
echo &quote;&lt;/p&
<?php

$dir = "./";

// searching of filetypes
$filetypes = Array( "php","htm" );

// the title
// [pagename] => [name]
$titles = Array( "index.php"=>"startsidan", "heja.php"=>"hejsidan" );

$foundtype = "";

if ( is_dir($dir) ) {
if ( $dh = opendir($dir) ) {

$filenames = Array();

while ( ($file = readdir($dh) ) != false) {
$foundtype = explode(".",$file);
if ( ($file != "." && $file != ".." && $file[0] != '.') && array_key_exists($file, $titles)) {
$filenames[] = $file;
}
}
closedir($dh);
}
}

foreach($filenames as $files)
{
include $file;
}

//
// What is all this stuff for?
//

$maxnum = 10;
$count = count( $filenames );
if ( $count > 10 )
$count = $maxnum;

if ( $count > 0 ) {
echo "$count recent updated pages:<p>";
for ($i = 0; $i < $count; $i++) {
// namn som visas om inte filen finns med i listan
$tmp = "Untitled";
if ( array_key_exists($filenames[$i], $titles) ) {
$tmp = $titles[$filenames[$i]];
}
echo ($i+1).". <a href=\"$filenames[$i]\">".$tmp."</a> ( ".date("Y-m-d H:i:s", filemtime($filenames[$i]))." )<br>";
}
echo "</p>";
}
else {
echo "<p>Didn't found any webpages.</p>";
}
?>


Hope this works.

Posted: Thu Jul 07, 2005 7:19 am
by phpnewbdude
I'm confused. I need to remove those fiiles at the top that the script is looking for. When you run this script it says No files found....

This needs to be taken out... but when I remove it the script doesn't work... anyone help?

Code: Select all

// the title
// [pagename] => [name]
$titles = Array( "index.php"=>"startsidan", "heja.php"=>"hejsidan" );
pt doesn't work... anyone help?

Code: Select all

// the title
// [pagename] => [name]
$titles = Array( "index.php"=>"startsidan", "heja.php"=>"hejsidan" );
the script is looking for. When you run this script it says No files found....

This needs to be taken out... but when I remove it the script doesn't work... anyone help?

Code: Select all

// the title
// [pagename] => [name]
$titles = Array( "index.php"=>"startsidan", "heja.php"=>"hejsidan" );
to be taken out... but when I remove it the script doesn't work... anyone help?

Code: Select all

// the title
// &#1111;pagename] =&gt; &#1111;name]
$titles = Array( &quote;index.phpat the script is looking for. When you run this script it says No files found....

This needs to be taken out... but when I remove it the script doesn't work...  anyone help?

Code: Select all

// the title
// [pagename] => [name]
$titles = Array( "index.php"=>"startsidan", "heja.php"=>"hejsidan" );
und....

This needs to be taken out... but when I remove it the script doesn't work... anyone help?

Code: Select all

// the title
// [pagename] =&gt; &#1111;name]
$titles = Array( &quote;index.This needs to be taken out... but when I remove it the script doesn't work...  anyone help?

Code: Select all

// the title
// [pagename] => &#ed to remove those fiiles at the top that the script is looking for. When you run this script it says No files found....

This needs to be taken out... but when I remove it the script doesn't work...  anyone help?

Code: Select all

// the title
// [pagename] => [name]
$titles = Array( "index.php"=>"startsidan", "heja.php"=>"hejsidan" );
e fiiles at the top that the script is looking for. When you run this script it says No files found....

This needs to be taken out... but when I remove it the script doesn't work... anyone help?

Code: Select all

// the title
// [pagename] => [name]
$titles = Array( "index.php"=>"startsidan", "heja.php"=>"hejsidan" // the title
// [pagename] => [name]
$titles = Array( "index.php"=>"startsidan", "heja.php"=>"hejsidan" );

Posted: Thu Jul 07, 2005 8:28 am
by hairyjim
The script is slightly confusng. What is it you are trying to do. Forget the script you have posted and just write down what you want to achieve.

Jim

Posted: Thu Jul 07, 2005 8:32 am
by phpnewbdude
I just want to display the last 10 .htm files updated on my website.