Current location: Hot Scripts Forums » Programming Languages » PHP » Is there javascript.... (show folder contents)


Is there javascript.... (show folder contents)

Reply
  #1 (permalink)  
Old 07-19-06, 06:17 AM
Ady_M Ady_M is offline
Newbie Coder
 
Join Date: Jul 2006
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Is there javascript....

I'm not sure if this should be in Script requests, but I just wondered if there is any JavaScript avaliable that will allow my page to do this:

On the page I want a section which will contain a list of file names in one of the folders on the site, and that it can read if any new files have been added to the folder, and if so, update itself by adding the new file (onto the page).

Any help would be appreciated.
Reply With Quote
  #2 (permalink)  
Old 07-19-06, 06:22 AM
nova912's Avatar
nova912 nova912 is offline
Code Guru
 
Join Date: Sep 2004
Location: Traverse City, MI, USA
Posts: 821
Thanks: 0
Thanked 0 Times in 0 Posts
You might be better off using PHP to accomplish this, try asking in the php boards or have the mod move this one. Sorry i have been up all night and i dont know 100% how to do this off the top of my head but i have done this befor using php.
Reply With Quote
  #3 (permalink)  
Old 07-19-06, 06:30 AM
TwoD TwoD is offline
Community VIP
 
Join Date: Sep 2003
Location: 404
Posts: 1,813
Thanks: 0
Thanked 0 Times in 0 Posts
Javascript doesn't have access to the filesystem on the server because it runs on the client.
I'll move this to the PHP section.
__________________
[W3Schools - learn all about the standards.] [QuirksMode - Browser Quirks] [MS's Online Reference Docs] [DOM in Gecko.]
Please pay attention to stickys, announcements and forum rules, thank you.
Please also remember Code Wrappers and [SOLVED] Marking, this helps everyone.
Reply With Quote
  #4 (permalink)  
Old 07-19-06, 06:58 AM
Nico's Avatar
Nico Nico is offline
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 8,075
Thanks: 11
Thanked 88 Times in 83 Posts
Here's an example.

PHP Code:



$path 
'./'// You may want to change this.

$dir opendir($path);

while ((
$file readdir($dir)) !== false)
{
     if (!
in_array($file, array('.''..')) )
     {
          echo 
$file .'<br />'"\n";
     }
}

closedir($dir); 
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Add javascript after load? <?Wille?> JavaScript 14 03-31-06 04:52 AM
Mixing some HTML into some JavaScript thatonedude JavaScript 2 12-30-05 11:04 AM
javascript /forms /checkboxes /arrays ski_woman JavaScript 1 11-16-04 04:08 AM
Order of vbscript and javascript in ASP marlin ASP 0 06-03-04 03:01 PM
Reaaly stuck about javascript over frames muratisik JavaScript 1 12-14-03 11:58 AM


All times are GMT -5. The time now is 07:21 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.