Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 12-02-2003, 10:37 PM   #1
Carlito
Confirmed User
 
Industry Role:
Join Date: Dec 2001
Location: Texas
Posts: 856
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 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-03-2003, 01:43 AM   #2
Carlito
Confirmed User
 
Industry Role:
Join Date: Dec 2001
Location: Texas
Posts: 856
blurb
Carlito is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.