Jump to content

Check how many files on a server are named "xxx"?...


ShootingBlanks

Recommended Posts

Hello.  I'm very new to JS, so this may not be a difficult thing...

 

I have a bunch of files on a server that start with "ds_" then have a number then ".php".  So, "ds_1.php", "ds_2.php", "ds_3.php", etc.  The numbers are all in succession (and the first one will always be "ds_1.php"), but the total number that exist changes regularly.  I need a "for" loop in javascript that will run through as many "ds_x.php" pages there are.

 

So if there are pages for "ds_1.php" through "ds_5.php", then I need code that says:

 

"For every page on the server from ds_1.php through ds_5.php, do something."

 

Thanks for any help that can be offered!!!  :)

Link to comment
Share on other sites

I don't think there is any way of doing that as far as i know.

 

But here's me thinking this would be easier to do with a simple php loop and inline the JS script in it.

 

Not very efficient but should do the job.

 

Yeah - I figured that would be the solution.  Just checking if there was another way.  Thanks, though!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.