GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Quick PHP Help (https://gfy.com/showthread.php?t=204076)

Carlito 12-02-2003 10:37 PM

Quick PHP Help
 
I am working with a script that was written for me before, my PHP skills are virtually nonexistant and I need to edit the script to work multiple times on one page - I can't seem to do that with most standard functions.

If someone could ICQ me or reply here and offer a suggestion, i`d be stoked.

Quote:





<?php


define('MAX_FILES', 5);

// changed below to save the path in a variable
$dirpath = '.';

$dp = opendir($dirpath);


if ($dp) {

while( $item = readdir($dp) )
{

if ( $item hahahaha '.' || $item hahahaha '..' )
continue;

// added this to skip files and only get dirs
if (!is_dir($dirpath . '/' . $item))
continue;

// fixed error: path was not included
// changed the way items were added to the array, not sure it was an error.
if ($mtime = @filemtime($dirpath . '/' . $item))
$all_files[$mtime][count($all_files[$mtime])] = $item;
}
krsort($all_files);
foreach($all_files as $time=>$files)
{
for($i=0; $i < count($files); $i++)

{
$file = $files[$i];
$date = date("m.d.y", $time);

if (++$count > MAX_FILES)
break;
else {

print <<<EOF

EOF;



}
}

}
closedir($dp);
unset($all_files);
} else {
print("Could not open directory.\n");
}


?>




At the moment if I use this code twice in a page, it never stops working from the first code, into the second.

Carlito 12-03-2003 01:43 AM

blurb


All times are GMT -7. The time now is 02:48 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123