Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

counting files

Status
Not open for further replies.

davikokar

Technical User
May 13, 2004
523
IT
hallo,

I am building a website and I would like to have a different banner background picture everytime the page loads. I would like the javascript code to count the available pictures (they are in a specific folder on the server: banner_img/) and then it should produce an array with the names of the pics, and finally assign randomly one to the background. The aim is: I would be able to add/remove pictures from my folder without the need to alter the javascript.

My question is: can I count files in this folder? Do you have an example on how to do it? Thanks
 
You should use whatever server-side language to accomplish this instead of javascript. ASP is starting to become a dinosaur, comparatively speaking, but it is more than capable of doing exactly what you are asking for. So, any server side language that you're using should be able to do this.

-kaht

Lisa, if you don't like your job you don't strike. You just go in every day and do it really half-assed. That's the American way. - Homer Simpson

[small]<P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <.</B>[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top