Lost Password?


Go Back   CodeCall Programming Forum > Web Development Forum > PHP Forum

PHP Forum Use this forum to discuss all aspects of PHP Development. PHP is a server-side, cross-platform, HTML embedded scripting language that lets you create dynamic web pages.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-18-2008, 04:28 PM
Jaan's Avatar   
Jaan Jaan is offline
Mod
 
Join Date: Dec 2006
Location: Estonia
Age: 17
Posts: 930
Last Blog:
AdStar Ad Control Pa...
Rep Power: 16
Jaan is a jewel in the roughJaan is a jewel in the roughJaan is a jewel in the roughJaan is a jewel in the rough
Send a message via MSN to Jaan
Default Lot's of errors

Umm.. i have this problemo..
here's my function:

PHP Code:
function list_dir($dir){
if(
is_dir($dir)){
if(
$handle opendir($dir)){
echo 
"<form action='' method='post'>";
echo 
"<table width='100%' border='0' align='center'>";
while((
$file readdir($handle)) !== false){

$filesize filesize($file);
$lastchanged date("F d Y - H:i:s",filemtime($file));
$filetype filetype($file);
if(
$filetype == "file"){
$filetype "File";
}elseif(
$filetype == "dir"){
$filetype "Directory";
}

if(
is_dir($file)){
$url "?act=show&folder=".$file;
}elseif(!
is_dir($file)){
$url "?act=show&file=".$file;
}

if(
$file != "." && $file != ".." && $file != "Thumbs.db" && is_dir($file)){
echo 
"<tr>";
echo 
"<td width='25%' bgcolor='#cedee4'><input type='checkbox' name='".$file."'>&nbsp;<a href='".$url."'><font id='base-text' style='color:black'>".$file."</font></a></td>";
echo 
"<td width='25%' bgcolor='#cedee4'><font id='base-text' style='color:black'>".filesize_r($file)."&nbsp;bytes</font></td>";
echo 
"<td width='25%' bgcolor='#cedee4'><font id='base-text' style='color:black'>".$filetype."</font></td>";
echo 
"<td width='25%' bgcolor='#cedee4'><font id='base-text' style='color:black'>".$lastchanged."</font></td>";
echo 
"</tr>";
}
}

closedir($handle);
}
}

and here's now i'll display my directories:

PHP Code:
$rootdir $_SERVER["APPL_PHYSICAL_PATH"];
$subdir $_SERVER['PHP_SELF'];
$subdir explode("/"$subdir);
$subdir $subdir['0'];
$folder $_GET['folder'];
$pathUrl $rootdir."\\".$subdir;
$pathSplit explode("\\"$pathUrl);
$pathSize sizeof($pathSplit);
$pathReal $pathSize-2;
$path $pathSplit[$pathReal];
list_dir($rootdir); 
:/ but i will get these errors..:

Quote:
Warning: filesize() [function.filesize]: stat failed for calc.php in D:\Program Files\Abyss Web Server\htdocs\fmp\index.php on line 43

Warning: filemtime() [function.filemtime]: stat failed for calc.php in D:\Program Files\Abyss Web Server\htdocs\fmp\index.php on line 44

Warning: filetype() [function.filetype]: Lstat failed for calc.php in D:\Program Files\Abyss Web Server\htdocs\fmp\index.php on line 45

Warning: filesize() [function.filesize]: stat failed for cmd in D:\Program Files\Abyss Web Server\htdocs\fmp\index.php on line 43

Warning: filemtime() [function.filemtime]: stat failed for cmd in D:\Program Files\Abyss Web Server\htdocs\fmp\index.php on line 44

Warning: filetype() [function.filetype]: Lstat failed for cmd in D:\Program Files\Abyss Web Server\htdocs\fmp\index.php on line 45

Warning: filesize() [function.filesize]: stat failed for downloadcounter in D:\Program Files\Abyss Web Server\htdocs\fmp\index.php on line 43

Warning: filemtime() [function.filemtime]: stat failed for downloadcounter in D:\Program Files\Abyss Web Server\htdocs\fmp\index.php on line 44

Warning: filetype() [function.filetype]: Lstat failed for downloadcounter in D:\Program Files\Abyss Web Server\htdocs\fmp\index.php on line 45

Warning: filesize() [function.filesize]: stat failed for ext-2.0 in D:\Program Files\Abyss Web Server\htdocs\fmp\index.php on line 43

Warning: filemtime() [function.filemtime]: stat failed for ext-2.0 in D:\Program Files\Abyss Web Server\htdocs\fmp\index.php on line 44

Warning: filetype() [function.filetype]: Lstat failed for ext-2.0 in D:\Program Files\Abyss Web Server\htdocs\fmp\index.php on line 45

Warning: filesize() [function.filesize]: stat failed for fm in D:\Program Files\Abyss Web Server\htdocs\fmp\index.php on line 43

Warning: filemtime() [function.filemtime]: stat failed for fm in D:\Program Files\Abyss Web Server\htdocs\fmp\index.php on line 44

Warning: filetype() [function.filetype]: Lstat failed for fm in D:\Program Files\Abyss Web Server\htdocs\fmp\index.php on line 45

Warning: filesize() [function.filesize]: stat failed for fmp in D:\Program Files\Abyss Web Server\htdocs\fmp\index.php on line 43

Warning: filemtime() [function.filemtime]: stat failed for fmp in D:\Program Files\Abyss Web Server\htdocs\fmp\index.php on line 44

Warning: filetype() [function.filetype]: Lstat failed for fmp in D:\Program Files\Abyss Web Server\htdocs\fmp\index.php on line 45

Warning: filesize() [function.filesize]: stat failed for forum in D:\Program Files\Abyss Web Server\htdocs\fmp\index.php on line 43

Warning: filemtime() [function.filemtime]: stat failed for forum in D:\Program Files\Abyss Web Server\htdocs\fmp\index.php on line 44

Warning: filetype() [function.filetype]: Lstat failed for forum in D:\Program Files\Abyss Web Server\htdocs\fmp\index.php on line 45

Warning: filesize() [function.filesize]: stat failed for fw in D:\Program Files\Abyss Web Server\htdocs\fmp\index.php on line 43

Warning: filemtime() [function.filemtime]: stat failed for fw in D:\Program Files\Abyss Web Server\htdocs\fmp\index.php on line 44

Warning: filetype() [function.filetype]: Lstat failed for fw in D:\Program Files\Abyss Web Server\htdocs\fmp\index.php on line 45

Warning: filesize() [function.filesize]: stat failed for gd in D:\Program Files\Abyss Web Server\htdocs\fmp\index.php on line 43

Warning: filemtime() [function.filemtime]: stat failed for gd in D:\Program Files\Abyss Web Server\htdocs\fmp\index.php on line 44

Warning: filetype() [function.filetype]: Lstat failed for gd in D:\Program Files\Abyss Web Server\htdocs\fmp\index.php on line 45

Warning: filesize() [function.filesize]: stat failed for mime.php in D:\Program Files\Abyss Web Server\htdocs\fmp\index.php on line 43

Warning: filemtime() [function.filemtime]: stat failed for mime.php in D:\Program Files\Abyss Web Server\htdocs\fmp\index.php on line 44

Warning: filetype() [function.filetype]: Lstat failed for mime.php in D:\Program Files\Abyss Web Server\htdocs\fmp\index.php on line 45

Warning: filesize() [function.filesize]: stat failed for phpadmin in D:\Program Files\Abyss Web Server\htdocs\fmp\index.php on line 43

Warning: filemtime() [function.filemtime]: stat failed for phpadmin in D:\Program Files\Abyss Web Server\htdocs\fmp\index.php on line 44

Warning: filetype() [function.filetype]: Lstat failed for phpadmin in D:\Program Files\Abyss Web Server\htdocs\fmp\index.php on line 45

Warning: filesize() [function.filesize]: stat failed for phpbb in D:\Program Files\Abyss Web Server\htdocs\fmp\index.php on line 43

Warning: filemtime() [function.filemtime]: stat failed for phpbb in D:\Program Files\Abyss Web Server\htdocs\fmp\index.php on line 44

Warning: filetype() [function.filetype]: Lstat failed for phpbb in D:\Program Files\Abyss Web Server\htdocs\fmp\index.php on line 45

Warning: filesize() [function.filesize]: stat failed for test in D:\Program Files\Abyss Web Server\htdocs\fmp\index.php on line 43

Warning: filemtime() [function.filemtime]: stat failed for test in D:\Program Files\Abyss Web Server\htdocs\fmp\index.php on line 44

Warning: filetype() [function.filetype]: Lstat failed for test in D:\Program Files\Abyss Web Server\htdocs\fmp\index.php on line 45

Warning: filesize() [function.filesize]: stat failed for tree in D:\Program Files\Abyss Web Server\htdocs\fmp\index.php on line 43

Warning: filemtime() [function.filemtime]: stat failed for tree in D:\Program Files\Abyss Web Server\htdocs\fmp\index.php on line 44

Warning: filetype() [function.filetype]: Lstat failed for tree in D:\Program Files\Abyss Web Server\htdocs\fmp\index.php on line 45
:/ maybe someone can help me and tell me what's wrong
__________________


Cheap & Professional Web Design | Need help? Send a PM
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 02-18-2008, 04:33 PM
phpforfun's Avatar   
phpforfun phpforfun is offline
Programming God
 
Join Date: Feb 2008
Posts: 886
Last Blog:
Programming "Just a ...
Rep Power: 9
phpforfun will become famous soon enoughphpforfun will become famous soon enough
Default

Its giving you an error for each file..?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-18-2008, 04:40 PM
Jaan's Avatar   
Jaan Jaan is offline
Mod
 
Join Date: Dec 2006
Location: Estonia
Age: 17
Posts: 930
Last Blog:
AdStar Ad Control Pa...
Rep Power: 16
Jaan is a jewel in the roughJaan is a jewel in the roughJaan is a jewel in the roughJaan is a jewel in the rough
Send a message via MSN to Jaan
Default

yup yup.. ^^
well.. it goes like this

Main folder
D:\Program Files\Abyss Web Server\htdocs

Folder and file where i'm executing my script
D:\Program Files\Abyss Web Server\htdocs\fmp\index.php

and i try to get info from
D:\Program Files\Abyss Web Server\htdocs

but it don't wanna work.. it's so wierd
__________________


Cheap & Professional Web Design | Need help? Send a PM
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-18-2008, 04:42 PM
phpforfun's Avatar   
phpforfun phpforfun is offline
Programming God
 
Join Date: Feb 2008
Posts: 886
Last Blog:
Programming "Just a ...
Rep Power: 9
phpforfun will become famous soon enoughphpforfun will become famous soon enough
Default

so you're trying to recall files from "../"

I dont see that anywhere in your code, did you substitute it with something that I dont get? lol
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-18-2008, 04:43 PM
Jaan's Avatar   
Jaan Jaan is offline
Mod
 
Join Date: Dec 2006
Location: Estonia
Age: 17
Posts: 930
Last Blog:
AdStar Ad Control Pa...
Rep Power: 16
Jaan is a jewel in the roughJaan is a jewel in the roughJaan is a jewel in the roughJaan is a jewel in the rough
Send a message via MSN to Jaan
Default

i tried it.. it don't work
__________________


Cheap & Professional Web Design | Need help? Send a PM
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #6 (permalink)  
Old 02-18-2008, 07:36 PM
John's Avatar   
John John is offline
Co-Administrator
 
Join Date: Jul 2006
Age: 20
Posts: 3,433
Last Blog:
Google Web Toolkit
Rep Power: 20
John has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond repute
Send a message via AIM to John Send a message via MSN to John
Default

stat() is only available on operating systems [not Windows] that support `st_blksize.` Upon failure, stat() throws an E_WARNING - hence your warnings.
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum | My Blog
Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 02-26-2008, 09:00 AM
Jaan's Avatar   
Jaan Jaan is offline
Mod
 
Join Date: Dec 2006
Location: Estonia
Age: 17
Posts: 930
Last Blog:
AdStar Ad Control Pa...
Rep Power: 16
Jaan is a jewel in the roughJaan is a jewel in the roughJaan is a jewel in the roughJaan is a jewel in the rough
Send a message via MSN to Jaan
Default

Quote:
Originally Posted by John View Post
stat() is only available on operating systems [not Windows] that support `st_blksize.` Upon failure, stat() throws an E_WARNING - hence your warnings.
Okay... this don't help me much..
anyone have any ideas how to fix it?

btw.. these are the lines:

PHP Code:
43. $filesize filesize($file);
44. $lastchanged date("F d Y - H:i:s",filemtime($file));
45. $filetype filetype($file); 
__________________


Cheap & Professional Web Design | Need help? Send a PM

Last edited by Jaan; 02-26-2008 at 09:05 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 02-26-2008, 01:28 PM
John's Avatar   
John John is offline
Co-Administrator
 
Join Date: Jul 2006
Age: 20
Posts: 3,433
Last Blog:
Google Web Toolkit
Rep Power: 20
John has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond repute
Send a message via AIM to John Send a message via MSN to John
Default

Have you considered looking in the PHP manual, rather than asking someone to fix it for you?
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum | My Blog
Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 02-26-2008, 02:49 PM
Jaan's Avatar   
Jaan Jaan is offline
Mod
 
Join Date: Dec 2006
Location: Estonia
Age: 17
Posts: 930
Last Blog:
AdStar Ad Control Pa...
Rep Power: 16
Jaan is a jewel in the roughJaan is a jewel in the roughJaan is a jewel in the roughJaan is a jewel in the rough
Send a message via MSN to Jaan
Default

problem is that.. i havent used this stat() function
__________________


Cheap & Professional Web Design | Need help? Send a PM
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 02-26-2008, 03:00 PM
John's Avatar   
John John is offline
Co-Administrator
 
Join Date: Jul 2006
Age: 20
Posts: 3,433
Last Blog:
Google Web Toolkit
Rep Power: 20
John has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond repute
Send a message via AIM to John Send a message via MSN to John
Default

You don't, but the functions filesize(), filetype(), and filename() do.
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum | My Blog
Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump